cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [4/5] git commit: rename retList -> results and switch from Linked to ArrayList
Date Mon, 26 Mar 2012 21:02:07 GMT
rename retList -> results and switch from Linked to ArrayList


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/18b55642
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/18b55642
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/18b55642

Branch: refs/heads/trunk
Commit: 18b55642821d26f3507f08e8b3f71e1f23db5ae1
Parents: b565fdb
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Mar 23 12:47:21 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Mon Mar 26 15:53:20 2012 -0500

----------------------------------------------------------------------
 .../cassandra/utils/IntervalTree/IntervalTree.java |   23 ++++++++-------
 1 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/18b55642/src/java/org/apache/cassandra/utils/IntervalTree/IntervalTree.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/IntervalTree/IntervalTree.java b/src/java/org/apache/cassandra/utils/IntervalTree/IntervalTree.java
index a01ed53..954c796 100644
--- a/src/java/org/apache/cassandra/utils/IntervalTree/IntervalTree.java
+++ b/src/java/org/apache/cassandra/utils/IntervalTree/IntervalTree.java
@@ -21,6 +21,7 @@ package org.apache.cassandra.utils.IntervalTree;
  */
 
 
+import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 
@@ -50,12 +51,12 @@ public class IntervalTree<T>
 
     public List<T> search(Interval<T> searchInterval)
     {
-        List<T> retlist = new LinkedList<T>();
-        searchInternal(head, searchInterval, retlist);
-        return retlist;
+        List<T> results = new ArrayList<T>();
+        searchInternal(head, searchInterval, results);
+        return results;
     }
 
-    protected void searchInternal(IntervalNode node, Interval<T> searchInterval, List<T>
retList)
+    protected void searchInternal(IntervalNode node, Interval<T> searchInterval, List<T>
results)
     {
         if (null == head)
             return;
@@ -68,11 +69,11 @@ public class IntervalTree<T>
         {
             for (Interval<T> interval : node.intersects_left)
             {
-                retList.add(interval.Data);
+                results.add(interval.Data);
             }
 
-            searchInternal(node.left, searchInterval, retList);
-            searchInternal(node.right, searchInterval, retList);
+            searchInternal(node.left, searchInterval, results);
+            searchInternal(node.right, searchInterval, results);
             return;
         }
 
@@ -86,11 +87,11 @@ public class IntervalTree<T>
             {
                 if (interval.max.compareTo(searchInterval.min) >= 0)
                 {
-                    retList.add(interval.Data);
+                    results.add(interval.Data);
                 }
                 else break;
             }
-            searchInternal(node.right, searchInterval, retList);
+            searchInternal(node.right, searchInterval, results);
             return;
         }
 
@@ -104,11 +105,11 @@ public class IntervalTree<T>
             {
                 if (interval.min.compareTo(searchInterval.max) <= 0)
                 {
-                    retList.add(interval.Data);
+                    results.add(interval.Data);
                 }
                 else break;
             }
-            searchInternal(node.left, searchInterval, retList);
+            searchInternal(node.left, searchInterval, results);
             return;
         }
     }


Mime
View raw message