Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Commit

Permalink
Write sequence read-ahead cache to correct index (#3025)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalman committed Jan 5, 2017
1 parent 1e0a698 commit 528355c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/noms/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@attic/noms",
"license": "Apache-2.0",
"version": "65.7.0",
"version": "65.8.0",
"description": "Noms JS SDK",
"repository": "https://github.com/attic-labs/noms/tree/master/js/noms",
"main": "dist/commonjs/noms.js",
Expand Down
5 changes: 3 additions & 2 deletions js/noms/src/sequence.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ export class SequenceCursor<T, S: Sequence<any>> {
getChildSequence(): Promise<?S> {
if (this.readAhead && this.sequence.isMeta && !this.childSeqs) {
// Only readAhead when enabled, for meta sequences.
this.childSeqs = [];
const childSeqs = [];
for (let i = this.idx; i < this.sequence.length; i++) {
this.childSeqs.push(this.sequence.getChildSequence(i));
childSeqs[i] = this.sequence.getChildSequence(i);
}
this.childSeqs = childSeqs;
}

if (this.childSeqs && this.childSeqs[this.idx]) {
Expand Down

0 comments on commit 528355c

Please sign in to comment.