UTF8ToUnicode micro optimization
Original Reporter info from Mantis: Alextp2
-
Reporter name: CudaText man_
Original Reporter info from Mantis: Alextp2
- Reporter name: CudaText man_
Description:
https://github.com/graemeg/freepascal/blob/master/rtl/inc/ustrings.inc
Func has 2 places like this:
if IBYTE = 10 then begin (* if (PreChar&LtPos;>13) and FALSE then begin //Expand to crlf, conform UTF-8. //This procedure will break the memory alocation by //FPC for the widestring, so never use it. Condition never true due the "and FALSE". inc(OutputUnicode,2); PreChar:=10; end else *) begin inc(OutputUnicode); PreChar:=IBYTE; end; end else begin inc(OutputUnicode); PreChar:=IBYTE; end;
2 places. lines 1836, 1981.
Not needed "if IBYTE=10" and then/else with same content.
Mantis conversion info:
- Mantis ID: 38023
- Version: 3.3.1
- Fixed in version: 3.3.1
- Fixed in revision: 47284 (#c2454d53)