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