From: Catalin Marinas Date: Thu, 20 Mar 2008 23:12:33 +0000 (+0000) Subject: Check for unnecessary push/pop in 'float' X-Git-Tag: v0.14.2~17 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/6024afaa0dc5624a8552a96383b36058c4d2544c Check for unnecessary push/pop in 'float' Signed-off-by: Catalin Marinas --- diff --git a/stgit/commands/float.py b/stgit/commands/float.py index 0ba4446..5af7e85 100644 --- a/stgit/commands/float.py +++ b/stgit/commands/float.py @@ -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: