Permalink
Browse files

GEOT-3131 remove unnecessary cycle and sysout

  • Loading branch information...
tomasma5 committed May 8, 2013
1 parent 78bbdd1 commit 4ab2c45a27815db0622affccca1f578e5b14077d
Showing with 10 additions and 18 deletions.
  1. +10 −18 modules/extension/graph/src/main/java/org/geotools/graph/util/PriorityQueue.java
@@ -104,24 +104,16 @@ public int update(int i) {
return(i);
}
-
- public void update(Object value) {
- Integer index = ((Integer)m_obj2index.get(value));
- if (index == null) {
- for (int i = 1; i < m_count; i++) {
- Object o = (Object)m_values[i];
- if (o == value)
- System.out.println();
- }
- }
- update(index.intValue());
- //TODO: improve performance, dont use a linear search
-// for (int i = 1; i < m_values.length; i++) {
-// if (m_values[i] == value) {
-// update(i);
-// return;
-// }
-// }
+ /**
+ * This method find index based on object value in parameter and call update
+ * method on that index
+ *
+ * @param value - object which will be updated
+ */
+ public void update(Object value) {
+ Integer index = ((Integer) m_obj2index.get(value));
+ if (index != null)
+ update(index.intValue());
}
public boolean isEmpty() { return(m_count == 0); }

0 comments on commit 4ab2c45

Please sign in to comment.