[gitg/wip/patch-stage] Compute old offset difference only once



commit ff761cbe355d27233b09b8ea55874b0e53fee24e
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]