Skip to content

Commit 2525466

Browse files
authored
Merge pull request webpack#6001 from lencioni/concatenation-efficiency
Simplify identifier creation in ConcatenatedModules
2 parents 7bbf31e + 37d70bd commit 2525466

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/optimize/ConcatenatedModule.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,13 @@ class ConcatenatedModule extends Module {
295295
}
296296

297297
_createIdentifier() {
298-
const orderedConcatenationListIdentifiers = this._orderedConcatenationList.map(info => {
299-
switch(info.type) {
300-
case "concatenated":
301-
return info.module.identifier();
298+
let orderedConcatenationListIdentifiers = "";
299+
for(let i = 0; i < this._orderedConcatenationList.length; i++) {
300+
if(this._orderedConcatenationList[i].type === "concatenated") {
301+
orderedConcatenationListIdentifiers += this._orderedConcatenationList[i].module.identifier();
302+
orderedConcatenationListIdentifiers += " ";
302303
}
303-
}).filter(Boolean).join(" ");
304+
}
304305
const hash = crypto.createHash("md5");
305306
hash.update(orderedConcatenationListIdentifiers);
306307
return this.rootModule.identifier() + " " + hash.digest("hex");

0 commit comments

Comments
 (0)