不要怂,就是干,撸起袖子干!

Commit 55143e61 by Lemon

Use of .some() rather then .filter() to improve efficiency

1 parent 63e009f0
Showing with 2 additions and 2 deletions
......@@ -427,9 +427,9 @@ module.exports = (function() {
for (var attrName in row) {
if (row.hasOwnProperty(attrName) && (attrName !== calleeTableName)) {
existingEntry[attrName] = existingEntry[attrName] || []
var attrRowExists = existingEntry[attrName].filter(function(attrRow) {
var attrRowExists = existingEntry[attrName].some(function(attrRow) {
return Utils._.isEqual(attrRow, row[attrName])
})[0]
})
if (!attrRowExists) {
existingEntry[attrName].push(row[attrName])
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!