We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd6e0cb commit 6d3aa29Copy full SHA for 6d3aa29
src/main/java/com/github/underscore/U.java
@@ -3255,7 +3255,12 @@ public List<T> slice(final int start, final int end) {
3255
public static <T> List<List<T>> splitAt(final Iterable<T> iterable, final int position) {
3256
List<List<T>> result = newArrayList();
3257
int size = size(iterable);
3258
- int index = position < 0 ? 0 : (position > size ? size : position);
+ final int index;
3259
+ if (position < 0) {
3260
+ index = 0;
3261
+ } else {
3262
+ index = position > size ? size : position;
3263
+ }
3264
result.add(newArrayList(iterable).subList(0, index));
3265
result.add(newArrayList(iterable).subList(index, size));
3266
return result;
0 commit comments