mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 17:29:14 +00:00
Push values to stream from a regular loop instead of shifting the initial array
This commit is contained in:
parent
1cfb30658a
commit
a0a8e06c54
@ -160,9 +160,8 @@ class ReadableStrapiQuery extends Readable {
|
|||||||
this._fetched += count;
|
this._fetched += count;
|
||||||
|
|
||||||
// While there is at least one value to unpack
|
// While there is at least one value to unpack
|
||||||
while (results.length) {
|
for (const result of results) {
|
||||||
// Add the first one to the stream's queue
|
this.push(result);
|
||||||
this.push(results.shift());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the amount of fetched entities is smaller than the
|
// If the amount of fetched entities is smaller than the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user