Skip to content

Commit

Permalink
minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
mourner committed Mar 14, 2018
1 parent 114b46b commit fa5ca12
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/utils/Mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,16 @@ export default function Mappings ( hires ) {
if ( !str ) return;

const lines = str.split( '\n' );
const lastLine = lines.pop();

if ( lines.length ) {
for ( let i = 0; i < lines.length; i++ ) {
if ( lines.length > 1 ) {
for ( let i = 0; i < lines.length - 1; i++ ) {
generatedCodeLine++;
this.raw[generatedCodeLine] = rawSegments = [];
}
generatedCodeColumn = lastLine.length;
} else {
generatedCodeColumn += lastLine.length;
generatedCodeColumn = 0;
}

generatedCodeColumn += lines[lines.length - 1].length;
};

this.encode = () => {
Expand Down

0 comments on commit fa5ca12

Please sign in to comment.