summaryrefslogtreecommitdiff
path: root/share/server/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/server/main.js')
-rw-r--r--share/server/main.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/share/server/main.js b/share/server/main.js
index 43660c7b..a62ed1ff 100644
--- a/share/server/main.js
+++ b/share/server/main.js
@@ -104,11 +104,12 @@ while (cmd = eval(readline())) {
var values = null;
var reduceFuns = cmd[1];
var is_combine = false;
+
if (cmd[0] == "reduce") {
var kvs = cmd[2];
keys = new Array(kvs.length);
values = new Array(kvs.length);
- for (var i = 0; i < kvs.length; i++) {
+ for(var i = 0; i < kvs.length; i++) {
keys[i] = kvs[i][0];
values[i] = kvs[i][1];
}
@@ -122,7 +123,7 @@ while (cmd = eval(readline())) {
}
var reductions = new Array(funs.length);
- for (var i = 0; i < reduceFuns.length; i++) {
+ for(var i = 0; i < reduceFuns.length; i++) {
try {
reductions[i] = reduceFuns[i](keys, values, is_combine);
} catch (err) {