@nxtedition/rocksdb 10.0.8 → 10.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/binding.cc CHANGED
@@ -330,31 +330,27 @@ struct BaseIterator : public Closable {
330
330
  Init();
331
331
  }
332
332
 
333
- if (target_) {
334
- auto target = rocksdb::Slice(*target_);
335
-
336
- if ((upper_bound_ && target.compare(*upper_bound_) >= 0) || (lower_bound_ && target.compare(*lower_bound_) < 0)) {
337
- // TODO (fix): Why is this required? Seek should handle it?
338
- // https://github.com/facebook/rocksdb/issues/9904
339
- iterator_->SeekToLast();
340
- if (iterator_->Valid()) {
341
- iterator_->Next();
342
- }
343
- } else if (reverse_) {
344
- iterator_->SeekForPrev(target);
345
- } else {
346
- iterator_->Seek(target);
347
- }
348
-
349
- target_ = std::nullopt;
350
- } else if (reverse_) {
333
+ if (reverse_) {
351
334
  iterator_->SeekToLast();
352
335
  } else {
353
336
  iterator_->SeekToFirst();
354
337
  }
355
338
  }
356
339
 
357
- void Seek(const rocksdb::Slice& target) { target_ = target.ToString(); }
340
+ void Seek(const rocksdb::Slice& target) {
341
+ if ((upper_bound_ && target.compare(*upper_bound_) >= 0) || (lower_bound_ && target.compare(*lower_bound_) < 0)) {
342
+ // TODO (fix): Why is this required? Seek should handle it?
343
+ // https://github.com/facebook/rocksdb/issues/9904
344
+ iterator_->SeekToLast();
345
+ if (iterator_->Valid()) {
346
+ iterator_->Next();
347
+ }
348
+ } else if (reverse_) {
349
+ iterator_->SeekForPrev(target);
350
+ } else {
351
+ iterator_->Seek(target);
352
+ }
353
+ }
358
354
 
359
355
  rocksdb::Status Close() override {
360
356
  snapshot_.reset();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/rocksdb",
3
- "version": "10.0.8",
3
+ "version": "10.0.9",
4
4
  "description": "A low-level Node.js RocksDB binding",
5
5
  "license": "MIT",
6
6
  "main": "index.js",