OSDN Git Service
(root)
/
joypy
/
Thun.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40a627b
)
Minor cleanup.
author
Simon Forman
<sforman@hushmail.com>
Sat, 19 Dec 2020 00:10:45 +0000
(16:10 -0800)
committer
Simon Forman
<sforman@hushmail.com>
Sat, 19 Dec 2020 00:10:45 +0000
(16:10 -0800)
joy/utils/stack.py
patch
|
blob
|
history
diff --git
a/joy/utils/stack.py
b/joy/utils/stack.py
index
3582216
..
fc11151
100644
(file)
--- a/
joy/utils/stack.py
+++ b/
joy/utils/stack.py
@@
-206,17
+206,15
@@
def dnd(stack, from_index, to_index):
h, stack = stack
head.append(h)
diff += 1
- stack = item, stack
- while head:
- stack = head.pop(), stack
else:
# from > to
# so the destination is in the head list
- while
head
:
+ while
diff
:
stack = head.pop(), stack
- from_index -= 1
- if from_index == to_index:
- stack = item, stack
+ diff -= 1
+ stack = item, stack
+ while head:
+ stack = head.pop(), stack
return stack