mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
HTML: Move tab replacement to start of diffhighlight
This might improve performance, as we don't have to match again every line.
This commit is contained in:
@@ -14,7 +14,7 @@ var highlightDiffs = function() {
|
||||
for (var diffn = 0; diffn < diffs.length; diffn++) {
|
||||
var diff = diffs[diffn];
|
||||
|
||||
var content = diff.innerHTML.replace(/\s+$/, '');
|
||||
var content = diff.innerHTML.replace(/\t/g, " ");;
|
||||
|
||||
var line1 = "";
|
||||
var line2 = "";
|
||||
@@ -42,7 +42,7 @@ var highlightDiffs = function() {
|
||||
continue;
|
||||
}
|
||||
|
||||
l = l.replace(/\t/g, " ");
|
||||
|
||||
if (firstChar == "+") {
|
||||
// Highlight trailing whitespace
|
||||
if (m = l.match(/\s+$/))
|
||||
|
||||
Reference in New Issue
Block a user