Skip to content

Commit

Permalink
Merge pull request #6001 from lencioni/concatenation-efficiency
Browse files Browse the repository at this point in the history
Simplify identifier creation in ConcatenatedModules
  • Loading branch information
sokra committed Nov 24, 2017
2 parents 7bbf31e + 37d70bd commit 2525466
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/optimize/ConcatenatedModule.js
Expand Up @@ -295,12 +295,13 @@ class ConcatenatedModule extends Module {
}

_createIdentifier() {
const orderedConcatenationListIdentifiers = this._orderedConcatenationList.map(info => {
switch(info.type) {
case "concatenated":
return info.module.identifier();
let orderedConcatenationListIdentifiers = "";
for(let i = 0; i < this._orderedConcatenationList.length; i++) {
if(this._orderedConcatenationList[i].type === "concatenated") {
orderedConcatenationListIdentifiers += this._orderedConcatenationList[i].module.identifier();
orderedConcatenationListIdentifiers += " ";
}
}).filter(Boolean).join(" ");
}
const hash = crypto.createHash("md5");
hash.update(orderedConcatenationListIdentifiers);
return this.rootModule.identifier() + " " + hash.digest("hex");
Expand Down

0 comments on commit 2525466

Please sign in to comment.