Corrected small bug in index array update

pull/2/head
Louis Chatriot 12 years ago
parent ae0c0dd05a
commit e3e5b7951c
  1. 4
      lib/indexes.js
  2. 2
      package.json

@ -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);

@ -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",

Loading…
Cancel
Save