Changeset 3453 in josm for trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
- Timestamp:
- 2010-08-21T14:59:31+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java
r3157 r3453 575 575 return true; 576 576 } 577 // If anyone has suggestions for how to fix578 // this properly, I'm listening :)579 @SuppressWarnings("unchecked")580 private T convert(Object raw)581 {582 return (T)raw;583 }584 577 public boolean remove(Object o) { 585 return this.remove(convert(o)); 586 } 587 public boolean remove(T o) { 578 @SuppressWarnings("unchecked") T t = (T) o; 588 579 synchronized (split_lock) { 589 580 search_cache = null; // Search cache might point to one of removed buckets 590 QBLevel bucket = root.findBucket( o.getBBox());591 if (bucket.remove_content( o)) {581 QBLevel bucket = root.findBucket(t.getBBox()); 582 if (bucket.remove_content(t)) { 592 583 size--; 593 584 return true; … … 597 588 } 598 589 public boolean contains(Object o) { 599 QBLevel bucket = root.findBucket(convert(o).getBBox()); 600 return bucket != null && bucket.content != null && bucket.content.contains(o); 590 @SuppressWarnings("unchecked") T t = (T) o; 591 QBLevel bucket = root.findBucket(t.getBBox()); 592 return bucket != null && bucket.content != null && bucket.content.contains(t); 601 593 } 602 594
Note:
See TracChangeset
for help on using the changeset viewer.