mirror of https://github.com/webpack/webpack.git
remove unnecessary iteration if b.chunks is not set
This commit is contained in:
parent
9f27e92d42
commit
2f58138516
|
|
@ -205,9 +205,9 @@ class Chunk {
|
||||||
other.chunks.length = 0;
|
other.chunks.length = 0;
|
||||||
|
|
||||||
other.blocks.forEach(b => {
|
other.blocks.forEach(b => {
|
||||||
b.chunks = (b.chunks || [this]).map(c => {
|
b.chunks = b.chunks ? b.chunks.map(c => {
|
||||||
return c === other ? this : c;
|
return c === other ? this : c;
|
||||||
}, this);
|
}, this) : [this];
|
||||||
b.chunkReason = reason;
|
b.chunkReason = reason;
|
||||||
this.addBlock(b);
|
this.addBlock(b);
|
||||||
}, this);
|
}, this);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue