Well, this new method actually doesn't work, because i've written it like an UnitLL is a double linked list, while it's not the case.
Now, on a second though i think it's better if it would be a circular one, because using a such loop is not that bad.
JASS:
local UnitLL this = ...
loop
set this = this.next
exitwhen this == this.head
// your code here
endloop
Comparing to the former one :
JASS:
local UnitLL this = ...
loop
set this = this.next
exitwhen this == 0
// your code here
endloop
You can even use a variable if you want to win some "performance", and anyway in the first place if speed is such an issue you wouldn't use it in the very first place, that was never the main purpose of it.
The reason why a double linked list is better is because you have more possibilities like constantly looping through an UnitLL, of course you still can in the current state but it needs more code to do it.
It also reduces the code inside the methods of the UnitLL struct.
Now if i do that it will break the backward compatibility, but apparently nobody uses it, so it shouldn't be an issue, plus the fix is enough easy imho.
Also i've realized that there is a major bug with the onDeindex method, actually it doesn't register the code, this was probably introduced before the version 2.1 by a failed code optimization (i've checked only from this version and not older ones since i didn't had them on my computer while i was checking).
I attach the current unofficial version where this bug is fixed, i've also begin to make UnitLL circular, but the custom spell "LifeDrain" in the demo map doesn't work, it should be a problem with the method
addUnit and maybe or/and with the custom spell by itself.
I suppose other methods also need a fix.
Frankly i've quite lost the motivation to fix it right now, i think i will take a break for this summer, so it should be graveyarded until i will come with a fixed version.