[gitg/wip/techlivezh/diff-view-clean-up: 2/7] Remove unnecessary var assignment



commit e3d6e37bec22413524e1a0fb9843ba1c5d74e8d4
Author: Techlive Zheng <techlivezheng gmail com>
Date:   Tue Dec 24 17:46:48 2013 +0800

    Remove unnecessary var assignment
    
    The expression is only used and calculated once in every loop, no need
    to use a dedicated variable holding it.

 libgitg/resources/diff-view-html-builder.js |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/libgitg/resources/diff-view-html-builder.js b/libgitg/resources/diff-view-html-builder.js
index 228d32b..3f552a0 100644
--- a/libgitg/resources/diff-view-html-builder.js
+++ b/libgitg/resources/diff-view-html-builder.js
@@ -30,11 +30,10 @@ function diff_file(file, lnstate, data)
                for (var j = 0; j < h.lines.length; ++j)
                {
                        var l = h.lines[j];
-                       var o = String.fromCharCode(l.type);
 
                        var row = '<tr class="';
 
-                       switch (o)
+                       switch (String.fromCharCode(l.type))
                        {
                                case ' ':
                                        row += 'context"> \


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