remove unnecessary iteration if b.chunks is not set

This commit is contained in:
Tim Sebastian 2017-01-26 18:08:27 +11:00
parent 9f27e92d42
commit 2f58138516
1 changed files with 2 additions and 2 deletions

View File

@ -205,9 +205,9 @@ class Chunk {
other.chunks.length = 0;
other.blocks.forEach(b => {
b.chunks = (b.chunks || [this]).map(c => {
b.chunks = b.chunks ? b.chunks.map(c => {
return c === other ? this : c;
}, this);
}, this) : [this];
b.chunkReason = reason;
this.addBlock(b);
}, this);