Skip to content

Commit

Permalink
fix: fix implementation of #read when size=0 (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr authored Sep 17, 2024
1 parent b0361a0 commit 5712f9c
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 @@ -1097,7 +1097,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 5712f9c

Please sign in to comment.