[gitg] Compute old offset difference only once



commit 1b41165437f32bcd59a27014ea25c28f167ee2ae
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Tue Dec 31 17:09:44 2013 +0100

    Compute old offset difference only once

 libgitg/resources/diff-view.js |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/libgitg/resources/diff-view.js b/libgitg/resources/diff-view.js
index 36ea92a..532fd3b 100644
--- a/libgitg/resources/diff-view.js
+++ b/libgitg/resources/diff-view.js
@@ -224,13 +224,9 @@ function prepare_patchset(filediv)
                                last = [tp, offset + doffset, offset, length];
                                patches.push(last);
                        }
-
-                       doffset += added ? -length : length;
-               }
-               else
-               {
-                       doffset += added ? -length : length;
                }
+
+               doffset += added ? -length : length;
        }
 
        var filename = filediv.getAttribute('data-filename');


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