[Pkg-javascript-commits] [node-leveldown] 177/492: make scope binding fix far more eloquent

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Sun Jul 6 17:13:56 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 c39a15c14c6af51155f67bcffd45b396ebd0e7a3
Author: James Butler <james.butler at sandfox.co.uk>
Date:   Wed Jan 23 15:42:33 2013 +0000

    make scope binding fix far more eloquent
---
 lib/levelup.js | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/levelup.js b/lib/levelup.js
index 7dc3cc5..138247e 100644
--- a/lib/levelup.js
+++ b/lib/levelup.js
@@ -320,7 +320,7 @@ LevelUP.prototype.approximateSize = function(start, end, callback) {
     throw err
   }
 
-  var cb = function(err, size) {
+  this._db.approximateSize(start, end, function(err, size) {
     if (err) {
       err = new errors.OpenError(err)
       if (callback)
@@ -328,11 +328,7 @@ LevelUP.prototype.approximateSize = function(start, end, callback) {
       this.emit('error', err)
     } else if (callback)
       callback(null, size)
-  }
-
-  cb = cb.bind(this)
-
-  this._db.approximateSize(start, end, cb)
+  }.bind(this))
 }
 
 LevelUP.prototype.readStream = function (options) {

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