chiark / gitweb /
Check for unnecessary push/pop in 'float'
authorCatalin Marinas <catalin.marinas@gmail.com>
Thu, 20 Mar 2008 23:12:33 +0000 (23:12 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Thu, 20 Mar 2008 23:12:33 +0000 (23:12 +0000)
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
stgit/commands/float.py

index 0ba4446645a79aa722afc00a3940c7c3f70e613d..5af7e85374736848d968938ed24d537c0f640b63 100644 (file)
@@ -82,6 +82,13 @@ def func(parser, options, args):
             topop.append(top)
     topush = patches + topush
 
+    # remove common patches to avoid unnecessary pop/push
+    while topush and topop:
+        if topush[-1] != topop[-1]:
+            break
+        topush.pop()
+        topop.pop()
+
     # check whether the operation is really needed
     if topop != topush:
         if topop: