[gitg/wip/techlivezh/diff-view-clean-up: 3/7] Declare variables before the loop
- From: Techlive Zheng <techlivezh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/wip/techlivezh/diff-view-clean-up: 3/7] Declare variables before the loop
- Date: Wed, 25 Dec 2013 03:12:27 +0000 (UTC)
commit c91e852dd414b4ab9dcb03e4b03fc0fa3c27eb2a
Author: Techlive Zheng <techlivezheng gmail com>
Date: Tue Dec 24 18:08:12 2013 +0800
Declare variables before the loop
libgitg/resources/diff-view-html-builder.js | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libgitg/resources/diff-view-html-builder.js b/libgitg/resources/diff-view-html-builder.js
index 3f552a0..dc7915a 100644
--- a/libgitg/resources/diff-view-html-builder.js
+++ b/libgitg/resources/diff-view-html-builder.js
@@ -14,9 +14,6 @@ function diff_file(file, lnstate, data)
{
var h = file.hunks[i];
- var cold = h.range.old.start;
- var cnew = h.range.new.start;
-
var hunk_header = '<span class="hunk_stats">@@ -' + h.range.old.start + ',' +
h.range.old.lines + ' +' + h.range.new.start + ',' + h.range.new.lines + ' @@</span>';
hunk_header = lnstate.stagebutton + hunk_header;
@@ -27,11 +24,14 @@ function diff_file(file, lnstate, data)
<td class="hunk_header">' + hunk_header + '</td> \
</tr>';
+ var l, row, proc;
+ var cold = h.range.old.start;
+ var cnew = h.range.new.start;
for (var j = 0; j < h.lines.length; ++j)
{
- var l = h.lines[j];
+ l = h.lines[j];
- var row = '<tr class="';
+ row = '<tr class="';
switch (String.fromCharCode(l.type))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]