[Pkg-javascript-commits] [node-leveldown] 188/492: swap bufferstream for simple-bufferstream

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:13:57 UTC 2014


This is an automated email from the git hooks/post-receive script.

andrewrk-guest pushed a commit to annotated tag rocksdb-0.10.1
in repository node-leveldown.

commit ce79ed78af3b04cae33c4cf2a1f774124eb59cc3
Author: Rod Vagg <rod at vagg.org>
Date:   Sun Jan 27 11:43:51 2013 +1100

    swap bufferstream for simple-bufferstream
---
 lib/read-stream.js | 14 ++++++--------
 package.json       |  4 ++--
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/lib/read-stream.js b/lib/read-stream.js
index 50fb8b6..c149b7a 100644
--- a/lib/read-stream.js
+++ b/lib/read-stream.js
@@ -4,7 +4,7 @@
  */
 
 var Stream       = require('stream').Stream
-  , BufferStream = require('bufferstream')
+  , bufferStream = require('simple-bufferstream')
   , inherits     = require('util').inherits
   , extend       = require('util')._extend
 
@@ -61,6 +61,7 @@ function ReadStream (options, db, iteratorFactory) {
   var ready = function () {
     if (this._status == 'ended')
       return
+
     this._iterator = iteratorFactory(this._options)
     this.emit('ready')
     this._read()
@@ -98,19 +99,16 @@ ReadStream.prototype.pipe = function (dest) {
   if (typeof dest.add == 'function' && this._options.type == 'fstream') {
     this._dataEvent = 'entry'
     this.on('entry', function (data) {
-      var entry = new BufferStream()
+      var entry = bufferStream(new Buffer(data.value))
       entry.path = data.key.toString()
       entry.type = 'File'
       entry.props = {
-        type: 'File'
+          type: 'File'
         , path: data.key.toString()
       }
-      entry.once('data', process.nextTick.bind(null, entry.end.bind(entry)))
       entry.pause()
-      if (dest.add(entry) === false) {
+      if (dest.add(entry) === false)
         this.pause()
-      }
-      entry.write(data.value)
     }.bind(this))
   }
   return Stream.prototype.pipe.apply(this, arguments)
@@ -156,4 +154,4 @@ ReadStream.prototype.toString = function () {
 
 module.exports.create = function (options, db, iteratorFactory) {
   return new ReadStream(options, db, iteratorFactory)
-}
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index 7287f12..b6b48ec 100644
--- a/package.json
+++ b/package.json
@@ -26,8 +26,8 @@
   , "dependencies"    : {
         "errno"           : "~0.0.3"
       , "bindings"        : "~1.0.0"
-      , "concat-stream"   : "~0.0.9"
-      , "bufferstream"    : "~0.5.1"
+      , "concat-stream"   : "~0.1.1"
+      , "simple-bufferstream" : "~0.0.2"
     }
   , "devDependencies" : {
         "buster"          : "*"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-leveldown.git



More information about the Pkg-javascript-commits mailing list