summaryrefslogtreecommitdiff
path: root/share/server/filter.js
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2009-12-02 23:05:28 +0000
committerJohn Christopher Anderson <jchris@apache.org>2009-12-02 23:05:28 +0000
commit60a6b3e7ffa209da31d563beae33726412318957 (patch)
tree8daa0efe1941cf3b2b395af64ab96246e14876e4 /share/server/filter.js
parentc32443a012dfe90d6872af829e8df9b743010c90 (diff)
removed add_fun optimization for filters, this provides better concurrency at the cost of some function transfer/eval overhead, which will be optimized in a future patch.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@886334 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/server/filter.js')
-rw-r--r--share/server/filter.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/share/server/filter.js b/share/server/filter.js
index 23536db0..a683146a 100644
--- a/share/server/filter.js
+++ b/share/server/filter.js
@@ -11,11 +11,13 @@
// the License.
var Filter = {
- filter : function(docs, req, userCtx) {
+ filter : function(funSrc, docs, req, userCtx) {
+ var filterFun = compileFunction(funSrc);
+
var results = [];
try {
for (var i=0; i < docs.length; i++) {
- results.push((funs[0](docs[i], req, userCtx) && true) || false);
+ results.push((filterFun(docs[i], req, userCtx) && true) || false);
};
respond([true, results]);
} catch (error) {