From e3e5b7951ccb85a57f6c459d3f330715a4716503 Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Sat, 8 Jun 2013 16:40:41 +0200 Subject: [PATCH] Corrected small bug in index array update --- lib/indexes.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/indexes.js b/lib/indexes.js index 48ee5ce..5dec521 100644 --- a/lib/indexes.js +++ b/lib/indexes.js @@ -1,4 +1,4 @@ -var BinarySearchTree = require('binary-search-tree').BinarySearchTree +var BinarySearchTree = require('binary-search-tree').AVLTree , model = require('./model') , _ = require('underscore') , util = require('util') @@ -114,7 +114,7 @@ Index.prototype.remove = function (doc) { * Naive implementation, still in O(log(n)) */ Index.prototype.update = function (oldDoc, newDoc) { - if (util.isArray(oldDoc)) { this.updateMultipleDocs(oldDoc); } + if (util.isArray(oldDoc)) { this.updateMultipleDocs(oldDoc); return; } this.remove(oldDoc); diff --git a/package.json b/package.json index 38f25dc..5284980 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dependencies": { "async": "~0.2.8", "underscore": "~1.4.4", - "binary-search-tree": "0.1.4" + "binary-search-tree": "0.2.0" }, "devDependencies": { "chai": "1.0.x",