hyperbee
Advanced tools
Comparing version 2.19.3 to 2.19.4
@@ -724,6 +724,6 @@ const codecs = require('codecs') | ||
async getKey (seq) { | ||
const k = this.tree._keyCache.get(seq) | ||
const k = this.core.fork === this.tree.core.fork ? this.tree._keyCache.get(seq) : null | ||
if (k !== null) return k | ||
const key = (await this.getBlock(seq)).key | ||
this.tree._keyCache.set(seq, key) | ||
if (this.core.fork === this.tree.core.fork) this.tree._keyCache.set(seq, key) | ||
return key | ||
@@ -733,3 +733,3 @@ } | ||
async _getNode (seq) { | ||
const cached = this.tree._nodeCache.get(seq) | ||
const cached = this.core.fork === this.tree.core.fork ? this.tree._nodeCache.get(seq) : null | ||
if (cached !== null) return cached | ||
@@ -744,3 +744,3 @@ const entry = await this.core.get(seq, { ...this.options, valueEncoding: Node }) | ||
} | ||
this.tree._nodeCache.set(seq, wrap) | ||
if (this.core.fork === this.tree.core.fork) this.tree._nodeCache.set(seq, wrap) | ||
return wrap | ||
@@ -747,0 +747,0 @@ } |
{ | ||
"name": "hyperbee", | ||
"version": "2.19.3", | ||
"version": "2.19.4", | ||
"description": "An append-only B-tree running on a Hypercore.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
96323