mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 07:25:15 +02:00
Performance improvement for iD.Difference
Avoid creating lots of unnecessary temporaries by short circuiting in a common case.
This commit is contained in:
@@ -10,7 +10,7 @@ iD.Difference = function(base, head) {
|
||||
var changes = {}, length = 0;
|
||||
|
||||
function changed(h, b) {
|
||||
return !_.isEqual(_.omit(h, 'v'), _.omit(b, 'v'));
|
||||
return h !== b && !_.isEqual(_.omit(h, 'v'), _.omit(b, 'v'));
|
||||
}
|
||||
|
||||
_.each(head.entities, function(h, id) {
|
||||
|
||||
Reference in New Issue
Block a user