rocksdb-native 3.1.4 → 3.1.5

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/index.js CHANGED
@@ -80,9 +80,8 @@ class RocksDB {
80
80
  if (this._index !== -1) this._state.removeSession(this)
81
81
 
82
82
  if (force) {
83
- for (let i = this._state.sessions.length - 1; i >= 0; i--) {
84
- await this._state.sessions[i].close()
85
- }
83
+ while (this._state.sessions.length > 0)
84
+ await this._state.sessions[this._state.sessions.length - 1].close()
86
85
  }
87
86
 
88
87
  return this.isRoot() ? this._state.close() : Promise.resolve()
package/lib/state.js CHANGED
@@ -150,8 +150,9 @@ module.exports = class DBState extends ReadyResource {
150
150
 
151
151
  async _close() {
152
152
  while (!this.activity.isIdle()) await this.activity.idle()
153
- for (let i = this.sessions.length - 1; i >= 0; i--)
154
- await this.sessions[i].close()
153
+
154
+ while (this.sessions.length > 0)
155
+ await this.sessions[this.sessions.length - 1].close()
155
156
 
156
157
  for (const columnFamily of this.columnFamilies) columnFamily.destroy()
157
158
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rocksdb-native",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "description": "librocksdb bindings for JavaScript",
5
5
  "exports": {
6
6
  ".": "./index.js",