Skip to content

Commit

Permalink
fix: fix implementation of #read when size=0
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Sep 15, 2024
1 parent 9eea4b6 commit 37be908
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/N3Store.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export default class N3Store {

const iterable = this.readQuads(subject, predicate, object, graph);
stream._read = size => {
while (size-- > 0) {
while (--size >= 0) {
const { done, value } = iterable.next();
if (done) {
stream.push(null);
Expand Down Expand Up @@ -1053,7 +1053,7 @@ class DatasetCoreAndReadableStream extends Readable {
if (size > 0 && !this[ITERATOR])
this[ITERATOR] = this[Symbol.iterator]();
const iterable = this[ITERATOR];
while (size-- > 0) {
while (--size >= 0) {
const { done, value } = iterable.next();
if (done) {
this.push(null);
Expand Down

0 comments on commit 37be908

Please sign in to comment.