Changeset 2353 in josm
- Timestamp:
- 2009-10-30T22:27:57+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r2299 r2353 245 245 this.content = null; 246 246 return ret; 247 } 248 @SuppressWarnings("unchecked") 249 QBLevel[] newChildren() 250 { 251 // This is ugly and hackish. But, it seems to work, 252 // and using an ArrayList here seems to cost us 253 // a significant performance penalty -- 50% in my 254 // testing. Child access is one of the single 255 // hottest code paths in this entire class. 256 return (QBLevel[])Array.newInstance(this.getClass(), QuadTiling.TILES_PER_LEVEL); 247 257 } 248 258 // Get the correct index for the given primitive … … 304 314 abort("overwrote children"); 305 315 } 306 // This is ugly and hackish. But, it seems to work, 307 // and using an ArrayList here seems to cost us 308 // a significant performance penalty -- 50% in my 309 // testing. Child access is one of the single 310 // hottest code paths in this entire class. 311 children = (QBLevel[])Array.newInstance(this.getClass(), QuadTiling.TILES_PER_LEVEL); 316 children = newChildren(); 312 317 // deferring allocation of children until use 313 318 // seems a bit faster … … 878 883 // If anyone has suggestions for how to fix 879 884 // this properly, I'm listening :) 885 @SuppressWarnings("unchecked") 880 886 private T convert(Object raw) 881 887 { 882 //@SuppressWarnings("unchecked")883 888 return (T)raw; 884 889 }
Note:
See TracChangeset
for help on using the changeset viewer.