Skip to content

Commit

Permalink
remove commented out earlier caching attempt
Browse files Browse the repository at this point in the history
Caching worked, but might cause unpredictable issues somewhere else
  • Loading branch information
appy-one committed Oct 2, 2023
1 parent 3756aab commit 0badec1
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/storage/binary/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3390,7 +3390,6 @@ class NodeReader {
});
}

// #allocatedAddresses = null as StorageAddress[] | null;
async _treeDataWriter(binary: number[] | Buffer, index: number) {
if (binary instanceof Array) {
binary = Buffer.from(binary);
Expand All @@ -3406,10 +3405,6 @@ class NodeReader {
nr: Math.floor((headerLength + index + length) / recordSize),
offset: (headerLength + index + length) % recordSize,
};
// if (!this.#allocatedAddresses) {
// this.#allocatedAddresses = this.recordInfo.allocation.addresses;
// }
// const writeRecords = this.#allocatedAddresses.slice(startRecord.nr, endRecord.nr + 1);
const writeRecords = this.recordInfo.allocation.getAddresses(startRecord.nr, endRecord.nr + 1);
const writeRanges = NodeAllocation.fromAdresses(writeRecords).ranges;
const writes = [];
Expand Down Expand Up @@ -3445,10 +3440,6 @@ class NodeReader {
nr: Math.floor((headerLength + index + length) / recordSize),
offset: (headerLength + index + length) % recordSize,
};
// if (!this.#allocatedAddresses) {
// this.#allocatedAddresses = this.recordInfo.allocation.addresses;
// }
// const readRecords = this.#allocatedAddresses.slice(startRecord.nr, endRecord.nr + 1);
const readRecords = this.recordInfo.allocation.getAddresses(startRecord.nr, endRecord.nr + 1);
if (readRecords.length === 0) {
throw new Error(
Expand Down

0 comments on commit 0badec1

Please sign in to comment.