| | |
| | | |
| | | private static EntryIDSet newIDSetFromCursor(SequentialCursor<?, EntryID> cursor, boolean includeCurrent) |
| | | { |
| | | final long ids[] = new long[SCOPE_IDSET_LIMIT]; |
| | | long ids[] = new long[SCOPE_IDSET_LIMIT]; |
| | | int offset = 0; |
| | | if (includeCurrent) { |
| | | ids[offset++] = cursor.getValue().longValue(); |
| | |
| | | for(; offset < ids.length && cursor.next() ; offset++) { |
| | | ids[offset] = cursor.getValue().longValue(); |
| | | } |
| | | |
| | | ids = Arrays.copyOf(ids, offset); |
| | | Arrays.sort(ids); |
| | | |
| | | return offset == SCOPE_IDSET_LIMIT |
| | | ? EntryIDSet.newUndefinedSet() |
| | | : EntryIDSet.newDefinedSet(Arrays.copyOf(ids, offset)); |
| | | : EntryIDSet.newDefinedSet(ids); |
| | | } |
| | | |
| | | private <E1 extends Exception, E2 extends Exception> |