inefficient string comparisons
Original Reporter info from Mantis: BeniBela @benibela
-
Reporter name: Benito van der Zander
Original Reporter info from Mantis: BeniBela @benibela
- Reporter name: Benito van der Zander
Description:
fpc_AnsiStr_Compare_equal:
is slow, because the temporary string variables lead to reference counting and an implicit exception block, even if these variables are not used.
The final else block should be moved to a different function.
CompareStr:
is slow, because it always compares the same string byte by byte.
There should be if pointer(s1) = pointer(s2) then exit(0)
Or if p1 = p2 then exit(0) in CompareMemRange
Is it supposed to ignore the encoding?
Mantis conversion info:
- Mantis ID: 30777
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 35603 (#ae6b9652)
- Monitored by: » Vincent (Vincent Snijders)
- Target version: 3.2.0