[Pkg-javascript-commits] [node-jsonstream] 127/214: clear the object so that memory use is minimal
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 1 12:58:49 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-jsonstream.
commit 596888234132db8be316b7d63f70b574ffb517d3
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date: Fri Aug 22 11:42:32 2014 -0700
clear the object so that memory use is minimal
---
index.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/index.js b/index.js
index 83848af..6ecd87b 100755
--- a/index.js
+++ b/index.js
@@ -66,10 +66,15 @@ exports.parse = function (path, map) {
while (true) {
c = (j === this.stack.length) ? this : this.stack[j]
if (!c) return
- if (check(nextKey, c.key)) { i++; break}
+ if (check(nextKey, c.key)) {
+ i++;
+ this.stack[j].value = null
+ break
+ }
j++
}
}
+
}
if (j !== this.stack.length) return
@@ -80,6 +85,8 @@ exports.parse = function (path, map) {
if(null != (data = map ? map(data, actualPath) : data))
stream.queue(data)
delete this.value[this.key]
+ for(var k in this.stack)
+ this.stack[k].value = null
}
parser._onToken = parser.onToken;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-jsonstream.git
More information about the Pkg-javascript-commits
mailing list