Merge pull request #6694 from atom/mb-optimize-get-decorations

🐎 Avoid repeated array allocation in ::getDecorations
This commit is contained in:
Max Brunsfeld
2015-05-07 13:09:39 -07:00

View File

@@ -886,7 +886,7 @@ class DisplayBuffer extends Model
getDecorations: (propertyFilter) ->
allDecorations = []
for markerId, decorations of @decorationsByMarkerId
allDecorations = allDecorations.concat(decorations) if decorations?
allDecorations.push(decorations...) if decorations?
if propertyFilter?
allDecorations = allDecorations.filter (decoration) ->
for key, value of propertyFilter