Merge pull request #25 from pbu88/small_perf_improvement
Extracts variables out of a loop
This commit is contained in:
commit
cc858a24f9
1 changed files with 23 additions and 22 deletions
|
|
@ -119,13 +119,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
var diffLines = diffInput.split('\n');
|
var diffLines = diffInput.split('\n');
|
||||||
diffLines.forEach(function(line) {
|
|
||||||
// Unmerged paths, and possibly other non-diffable files
|
|
||||||
// https://github.com/scottgonzalez/pretty-diff/issues/11
|
|
||||||
// Also, remove some useless lines
|
|
||||||
if (!line || utils.startsWith(line, '*')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Diff */
|
/* Diff */
|
||||||
var oldMode = /^old mode (\d{6})/;
|
var oldMode = /^old mode (\d{6})/;
|
||||||
|
|
@ -149,6 +142,14 @@
|
||||||
var combinedNewFile = /^new file mode (\d{6})/;
|
var combinedNewFile = /^new file mode (\d{6})/;
|
||||||
var combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/;
|
var combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/;
|
||||||
|
|
||||||
|
diffLines.forEach(function(line) {
|
||||||
|
// Unmerged paths, and possibly other non-diffable files
|
||||||
|
// https://github.com/scottgonzalez/pretty-diff/issues/11
|
||||||
|
// Also, remove some useless lines
|
||||||
|
if (!line || utils.startsWith(line, '*')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var values = [];
|
var values = [];
|
||||||
if (utils.startsWith(line, 'diff')) {
|
if (utils.startsWith(line, 'diff')) {
|
||||||
startFile();
|
startFile();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue