3737 */
3838public class IntAllocator {
3939
40- // Invariant: Sorted in order of first element.
41- // Invariant: Intervals are non-overlapping, non-adjacent.
42- // This could really use being a balanced binary tree. However for normal
40+ // Invariant: Sorted in order of first element.
41+ // Invariant: Intervals are non-overlapping, non-adjacent.
42+ // This could really use being a balanced binary tree. However for normal
4343 // usages it doesn't actually matter.
4444 private IntervalList base ;
4545
@@ -116,12 +116,12 @@ public static IntervalList fromArray(int[] xs, int length){
116116
117117
118118 /**
119- * Creates an IntAllocator allocating integer IDs within the inclusive range
119+ * Creates an IntAllocator allocating integer IDs within the inclusive range
120120 * [start, end]
121121 */
122122 public IntAllocator (int start , int end ){
123- if (start > end )
124- throw new IllegalArgumentException ("illegal range [" + start +
123+ if (start > end )
124+ throw new IllegalArgumentException ("illegal range [" + start +
125125 ", " + end + "]" );
126126
127127 // Fairly arbitrary heuristic for a good size for the unsorted set.
@@ -148,7 +148,7 @@ public int allocate(){
148148 /**
149149 * Make the provided integer available for allocation again. This operation
150150 * runs in amortized O(sqrt(range size)) time: About every sqrt(range size)
151- * operations will take O(range_size + number of intervals) to complete
151+ * operations will take O(range_size + number of intervals) to complete
152152 * and the rest run in constant time.
153153 *
154154 * No error checking is performed, so if you double free or free an integer
@@ -162,11 +162,11 @@ public void free(int id){
162162 }
163163
164164 /**
165- * Attempt to reserve the provided ID as if it had been allocated. Returns
165+ * Attempt to reserve the provided ID as if it had been allocated. Returns
166166 * true if it is available, false otherwise.
167167 *
168- * This operation runs in O(id) in the worst case scenario, though it can
169- * usually be expected to perform better than that unless a great deal of
168+ * This operation runs in O(id) in the worst case scenario, though it can
169+ * usually be expected to perform better than that unless a great deal of
170170 * fragmentation has occurred.
171171 */
172172 public boolean reserve (int id ){
0 commit comments