DEV Community

Discussion on: How to Update the Database After a Drag-and-Drop Operation

Collapse
 
g4rry420 profile image
g4rry420

Hi Sho-ki,
Is there a particular reason that you used the 1024 for the index value and then also increment it by 1024 ? Why didn't you used index values such as 0,1,2,3,4, etcetera.

Collapse
 
shoki profile image
Shoki Ishii

Hi,
There is no major reason for this.
But see 'Step 5. If index_number overlaps in How it works'.
In the case using 1,2,3,4..., then index_number will immediately overlap with another index_number. This may result in slower processing, so I use a relatively large number, 1024, 2048, 3072..., which is not immediately overlap with another index_number.