You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
renumber(oldindex, newindex) :-
if oldindex == newindex:
return
bigid = max(index)
update index set index = -1 where index = oldindex
if oldindex < newindex:
update index set index = bigid + index
where index >= oldindex + 1
and index <= newindex
update index set index = index - bigid - 1
where index >= bigid
else:
update index set index = bigid + index
where index >= newindex
and index <= oldindex
update index set index = index - bigid + 1
where index >= bigid
update index set index = newindex
where index = -1