Permalink
Browse files

Remove map() shim.

  • Loading branch information...
1 parent 560479a commit e2170cb48aebed958ccee70154796cf05e7bc042 @sayrer committed Jul 19, 2011
Showing with 7 additions and 8 deletions.
  1. +7 −8 sync.js
View
15 sync.js
@@ -19,10 +19,6 @@ function filter(f, a) {
return a.filter(f);
}
-function map(f, a) {
- return a.map(f);
-}
-
function reduce(f, a, initial) {
return a.reduce(f, initial);
}
@@ -230,7 +226,8 @@ function edited(path, old, update) {
function _detectUpdates(stack, snapshot, current) {
/* check for edits and recurse into objects and arrays */
- return flattenArray(map(
+ var suspects = identifySuspects(snapshot, current);
+ return flattenArray(suspects.map(
function(key) {
var old = snapshot[key];
var update = current[key];
@@ -290,7 +287,8 @@ function _detectUpdates(stack, snapshot, current) {
return extend(changeSequence,
_detectUpdates(path, old, update));
- }, identifySuspects(snapshot, current)));
+ }
+ ));
}
var detectUpdates = partial(_detectUpdates, []);
@@ -426,8 +424,9 @@ function conflictsFromReplica(command, commandList) {
}
function conflictsFromReplicas(command, commandListsFromOtherReplicas) {
- return map(partial(conflictsFromReplica, command),
- commandListsFromOtherReplicas);
+ return commandListsFromOtherReplicas.map(
+ partial(conflictsFromReplica, command)
+ );
}
/**

0 comments on commit e2170cb

Please sign in to comment.