From 7e068ef2b07d64f7057c02784b768fee7fcc214d Mon Sep 17 00:00:00 2001 From: Mark Nadal Date: Thu, 11 Nov 2021 15:11:58 -0800 Subject: [PATCH] does this work? Check for typo errors... I didn't test. --- lib/rs3.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/rs3.js b/lib/rs3.js index 38015ec5..04f37fa3 100644 --- a/lib/rs3.js +++ b/lib/rs3.js @@ -87,15 +87,16 @@ function Store(opt){ if(err){ return Gun.log(err, err.stack) } var IT = data.IsTruncated, cbe = function(cb){ if(cb.end){ return } - if(Gun.obj.map(data.Contents, function(content){ - return cb(content.Key); - })){ cb.end = true; return } + var i = 0, c = data.Contents, tmp; while(tmp = c[i++]){ + if(cb(tmp.Key)){ cb.end = true; break } + } + if(cb.end){ return } if(IT){ return } // Stream interface requires a final call to know when to be done. cb.end = true; cb(); } - Gun.obj.map(cbs, cbe); - if(!IT){ Gun.obj.del(c.l, 1); return } + cbs.forEach(cbe);//Gun.obj.map(cbs, cbe); + if(!IT){ delete c.l[1]; return } params.ContinuationToken = data.NextContinuationToken; store.list(cb, match, params, cbs); });