Simplify generic Index* (and Compare*) further.
- Assuming that:
-
generic
Index*
andCompare*
rely on wrapping pointer overflow anyway; -
this overflow might happen only when calculating
pend
and not when iterating, and means unbounded iteration when you expect to find something (mainly, terminating #0) and are fine with UB otherwise; -
strings don’t occupy half of the address space (so
len = Low(SizeInt)
andlen = -1
are equivalent; actually,CompareWord
doesn’t check that and interpretslen = Low(SizeInt)
aslen = 0
,len = Low(SizeInt) + 1
aslen = 1
and so on — I changed this for consistency with others);
I think that anything related to pend < psrc
can be removed, and conditions changed from psrc < pend
to psrc <> pend
.
- Even if
PtrUint
wise loop found a difference, loweringpend
topsrc+sizeof(pointer)
is pointless, loop that iterates over a single value will guaranteedly stumble into it again.
Patch: pend.patch.
Edited by Rika