NListtree.mcc: fix sorted insert
commit18ced57933e13007d9f6840aa335c86f4056a036
authordeadwood <deadwood@fb15a70f-31f2-0310-bbcc-cdcc74a49acc>
Sat, 4 Jul 2015 20:16:49 +0000 (4 20:16 +0000)
committerdeadwood <deadwood@fb15a70f-31f2-0310-bbcc-cdcc74a49acc>
Sat, 4 Jul 2015 20:16:49 +0000 (4 20:16 +0000)
tree39d61d257ee72ebb2747aae792bb685a16fcd370
parentd7e03b947c989fbc4ab73c260451b1bb84839878
NListtree.mcc: fix sorted insert

Since the itaration starts from first element, there is no other
way to insert at head than explicitly return it. This reverts
one of the changes that was done in rev 536  of NList.

Additionally, the built in Head and Tail compare functions had
their implementation switched. The return needs to be < 0 to
iterate further (eventually reaching last element) and >= to
insert at this location, which will be HEAD for first call due
to first change.

The change has been tested with all 5 built in compare functions
and with external compare function.

Change is pushed upstream to NList team.

git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@50922 fb15a70f-31f2-0310-bbcc-cdcc74a49acc
workbench/classes/zune/nlist/nlisttree_mcc/NListtree.c