Code review comment for lp:~osomon/unity-2d/dnd-reorder-apps

Revision history for this message
Ugo Riboni (uriboni) wrote :

24 + onPressAndHold: {
25 + var id = items.get(currentIndex = index).desktop_file
26 + if (id != undefined) currentId = id
27 + }

items.get(currentIndex = index) saves you one line of code, but it makes the entire thing much less clear. In general assignements should be on their own separate line for clarity (relying on the fact that the "value" of an assignement is implicitly the assigned operand is clever but rather obscure).

Also when you rename currentIndex rename var id in a matching way since you're already there.

review: Needs Fixing

« Back to merge proposal