Use my style in getMatching

pull/2/head
Louis Chatriot 9 years ago
parent 3c5cdf9b7e
commit f916e69717
  1. 11
      lib/indexes.js

@ -236,14 +236,12 @@ Index.prototype.revertUpdate = function (oldDoc, newDoc) {
* @return {Array of documents}
*/
Index.prototype.getMatching = function (value) {
var _res, res
, self = this;
var self = this;
if (!util.isArray(value)) {
res = self.tree.search(value);
return self.tree.search(value);
} else {
_res = {};
res = [];
var _res = {}, res = [];
value.forEach(function (v) {
self.getMatching(v).forEach(function (doc) {
@ -254,8 +252,9 @@ Index.prototype.getMatching = function (value) {
Object.keys(_res).forEach(function (_id) {
res.push(_res[_id]);
});
return res;
}
return res;
};

Loading…
Cancel
Save