Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
gh-249 Remove commented code
  • Loading branch information
at055612 committed Mar 6, 2025
commit 9509f6bea115c7839e14881e4ecb4459211820d4
56 changes: 0 additions & 56 deletions src/main/java/org/lmdbjava/CursorIterable.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
*/
public final class CursorIterable<T> implements Iterable<CursorIterable.KeyVal<T>>, AutoCloseable {

// private final Comparator<T> comparator;
private final RangeComparator rangeComparator;
private final Cursor<T> cursor;
private final KeyVal<T> entry;
Expand All @@ -69,68 +68,13 @@
}
}

// static <T> RangeComparator createJavaRangeComparator(
// final KeyRange<T> range,
// final Comparator<T> comparator,
// final Supplier<T> currentKeySupplier) {
// final T start = range.getStart();
// final T stop = range.getStop();
// return new RangeComparator() {
// @Override
// public int compareToStartKey() {
// return comparator.compare(currentKeySupplier.get(), start);
// }
//
// @Override
// public int compareToStopKey() {
// return comparator.compare(currentKeySupplier.get(), stop);
// }
// };
// }

// /**
// * Calls down to mdb_cmp to make use of the comparator that LMDB uses for insertion order.
// *
// * @param txnPointer The pointer to the transaction.
// * @param dbiPointer The pointer to the Dbi so LMDB can use the comparator of the Dbi
// * @param proxy
// */
// private RangeComparator createLmdbDbiComparator(final Pointer txnPointer,
// final Pointer dbiPointer,
// final Pointer cursorKeyPointer,
// final KeyRange<T> range,
// final BufferProxy<T> proxy) {
// Objects.requireNonNull(txnPointer);
// Objects.requireNonNull(dbiPointer);
// Objects.requireNonNull(range);
// Objects.requireNonNull(cursor);
// // Allocate buffers for use with the start/stop keys if required.
// // Saves us copying bytes on each comparison
// final Key<T> startKey = createKey(range.getStart(), proxy);
// final Key<T> stopKey = createKey(range.getStop(), proxy);
//
// return new RangeComparator() {
// @Override
// public int compareToStartKey() {
// return LIB.mdb_cmp(txnPointer, dbiPointer, cursor.keyVal().pointerKey(),
// startKey.pointer());
// }
//
// @Override
// public int compareToStopKey() {
// return LIB.mdb_cmp(txnPointer, dbiPointer, cursor.keyVal().pointerKey(),
// stopKey.pointer());
// }
// };
// }

@Override
public void close() {
cursor.close();
try {
rangeComparator.close();
} catch (Exception e) {
throw new RuntimeException(e);

Check warning on line 77 in src/main/java/org/lmdbjava/CursorIterable.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/lmdbjava/CursorIterable.java#L76-L77

Added lines #L76 - L77 were not covered by tests
}
}

Expand Down
Loading