Skip to content

Commit

Permalink
count lines
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Dec 7, 2019
1 parent 6d27caa commit f9408f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lighthouse-core/computed/bundle-analysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function computeGeneratedFileSizesForCDT(sourceMapData) {
// });
continue;
}
mappingLength = lastGeneratedColumn - generatedColumn + 0;
mappingLength = lastGeneratedColumn - generatedColumn;
} else {
// TODO Buffer.byteLength?
mappingLength = line.length - generatedColumn;
Expand All @@ -93,10 +93,7 @@ function computeGeneratedFileSizesForCDT(sourceMapData) {
mappedBytes += mappingLength;
}

// TODO: remove?
// Don't count newlines as original version didn't count newlines
const totalBytes = content.length - lines.length + 1;

const totalBytes = content.length;
return {
files,
unmappedBytes: totalBytes - mappedBytes,
Expand Down
1 change: 1 addition & 0 deletions lighthouse-core/test/fixtures/source-maps/foo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f9408f3

Please sign in to comment.