mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
HTML: Improve diff display performance
This improves the diff performance by a factor of around 10. Things done to do this are, among others: * user String.replace(//g) instead of String.gsub(). It's *much* faster * Don't use anonymous inner functions for iteration, but instead use for loops * Don't use String.startsWith() if we can just compare a single character Because we are now so much faster, we can also show bigger diffs by default.
This commit is contained in:
+1
-1
@@ -139,7 +139,7 @@ var loadCommit = function() {
|
||||
|
||||
$("message").innerHTML = commit.message.replace(/\n/g,"<br>");
|
||||
|
||||
if (commit.diff.length < 10000) {
|
||||
if (commit.diff.length < 200000) {
|
||||
showDiffs();
|
||||
} else {
|
||||
$("details").innerHTML = "<a class='showdiff' href='' onclick='showDiffs(); return false;'>This is a large commit. Click here or press 'v' to view.</a>";
|
||||
|
||||
Reference in New Issue
Block a user