[gitg/wip/techlivezh/bug/720886: 1/7] Remove unnecessary 'tabrepl' var



commit 78834ea8775a0254aaa427865223073ba7a2f148
Author: Techlive Zheng <techlivezheng gmail com>
Date:   Tue Dec 24 17:38:41 2013 +0800

    Remove unnecessary 'tabrepl' var
    
    'tabrepl' is used only once, no need for a dedicated variable.

 libgitg/resources/diff-view-html-builder.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libgitg/resources/diff-view-html-builder.js b/libgitg/resources/diff-view-html-builder.js
index 3698326..228d32b 100644
--- a/libgitg/resources/diff-view-html-builder.js
+++ b/libgitg/resources/diff-view-html-builder.js
@@ -5,8 +5,6 @@ function html_escape(s)
 
 function diff_file(file, lnstate, data)
 {
-       tabrepl = '<span class="tab" style="width: ' + data.settings.tab_width + 'ex">\t</span>';
-
        var added = 0;
        var removed = 0;
 
@@ -75,7 +73,9 @@ function diff_file(file, lnstate, data)
                                break;
                        }
 
-                       row += '<td class="code">' + html_escape(l.content).replace(/\t/g, tabrepl) + '</td>';
+                       l.content = html_escape(l.content).replace(/\t/g, '<span class="tab" style="width: ' 
+ data.settings.tab_width + 'ex">\t</span>');
+
+                       row += '<td class="code">' + l.content + '</td>';
 
                        row += '</tr>';
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]