File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,6 @@ def iter_order(order, direction):
177177
178178 def reorder_func (direction ):
179179 """Reorders the function based on the direction."""
180- self .logger .debug ("Moving %s %s %s" % (func_name , direction , other_func ))
181180 if direction == "before" : # Move the function before the other function
182181 self .logger .debug ("[%s] Moving function before: %s" % (func_name , other_func ))
183182 func_names .insert (other_index , func_names .pop (func_index ))
@@ -204,6 +203,7 @@ def reorder_func(direction):
204203 self .logger .log (5 , "Function %s already after: %s" % (func_name , other_func ))
205204 else :
206205 raise ValueError ("Invalid direction: %s" % direction )
206+ func_index = func_names .index (func_name ) # Update the index after moving
207207 return changed
208208
209209 max_iterations = len (func_names ) * (len (before ) + 1 ) * (len (after ) + 1 ) # Prevent infinite loops
You can’t perform that action at this time.
0 commit comments