[Pkg-javascript-commits] [node-jsonstream] 80/214: fix memory usage problem

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 1 12:58:42 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 8b7df400500ba3e9a64aa3eee063ced1ad432057
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Sun Mar 17 18:29:48 2013 +1300

    fix memory usage problem
---
 index.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/index.js b/index.js
index 816ea2d..f534d6c 100644
--- a/index.js
+++ b/index.js
@@ -38,9 +38,10 @@ exports.parse = function (path) {
     })
 
 
-  var count = 0
+  var count = 0, _key
   if(!path || !path.length)
     path = null
+
   parser.onValue = function () {
     if(!this.root && this.stack.length == 1){
       stream.root = this.value
@@ -70,12 +71,11 @@ exports.parse = function (path) {
       return
       _path.push(c.key)
 
-  count ++
-  stream.queue(this.value[this.key])
-  for(var i in this.stack)
-    this.stack[i].value = {}
-  }
+    count ++
+    stream.queue(this.value[this.key])
+    delete this.value[this.key]
 
+  }
   parser._onToken = parser.onToken;
 
   parser.onToken = function (token, value) {

-- 
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