Skip to content

Commit 98dee79

Browse files
committed
Merge branch 'patch-1' of https://github.com/fissionxuiptz/closure_tree into pr106
2 parents 207c735 + 37ffcd7 commit 98dee79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/closure_tree/numeric_deterministic_ordering.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ def add_sibling(sibling, add_after = true)
117117
_ct_reorder_siblings(reorder_from_value)
118118

119119
# The sort order should be correct now except for self and sibling, which may need to flip:
120-
sibling_is_after = self.reload.sort_order < sibling.reload.sort_order
120+
sibling_is_after = self.reload.order_value < sibling.reload.order_value
121121
if add_after != sibling_is_after
122122
# We need to flip the sort orders:
123-
self_so, sib_so = self.sort_order, sibling.sort_order
124-
update_order_value(sib_so)
125-
sibling.update_order_value(self_so)
123+
self_ov, sib_ov = self.order_value, sibling.order_value
124+
update_order_value(sib_ov)
125+
sibling.update_order_value(self_ov)
126126
end
127127

128128
if prior_sibling_parent != self.parent

0 commit comments

Comments
 (0)