Skip to content

Commit 91df923

Browse files
committed
IGNITE-26740 Refactor GridIntList: remove copyWithout method
1 parent aadab9b commit 91df923

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

modules/core/src/main/java/org/apache/ignite/internal/util/GridIntList.java

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -163,44 +163,6 @@ else if (arr.length == idx)
163163
arr[idx++] = x;
164164
}
165165

166-
/**
167-
* Returns (possibly reordered) copy of this list, excluding all elements of given list.
168-
*
169-
* @param l List of elements to remove.
170-
* @return New list without all elements from {@code l}.
171-
*/
172-
public GridIntList copyWithout(GridIntList l) {
173-
assert l != null;
174-
175-
if (idx == 0)
176-
return new GridIntList();
177-
178-
if (l.idx == 0)
179-
return new GridIntList(Arrays.copyOf(arr, idx));
180-
181-
int[] newArr = Arrays.copyOf(arr, idx);
182-
int newIdx = idx;
183-
184-
for (int i = 0; i < l.size(); i++) {
185-
int rmVal = l.get(i);
186-
187-
for (int j = 0; j < newIdx; j++) {
188-
if (newArr[j] == rmVal) {
189-
190-
while (newIdx > 0 && newArr[newIdx - 1] == rmVal)
191-
newIdx--;
192-
193-
if (newIdx > 0) {
194-
newArr[j] = newArr[newIdx - 1];
195-
newIdx--;
196-
}
197-
}
198-
}
199-
}
200-
201-
return new GridIntList(newArr, newIdx);
202-
}
203-
204166
/**
205167
* @param i Index.
206168
* @return Value.

0 commit comments

Comments
 (0)