Skip to content

Bug fix and optimization of WideString length comparison with zero

Sergey Larin requested to merge sergy.larin/fpcsrc:widestr-cmp-empy-fix-opt into main
  • Fixed optimization Length(W)=0 -> (Pointer(W)=nil) or (PLongword(Pointer(W)-4)^=0) for WideString
    Before this MR it was like this: Length(W)=0 -> (Pointer(W)=nil) or (PSizeInt(Pointer(W)-SizeOf(SizeInt))^=0)
  • Optimized the comparison of a WideString variable with '':
    W='' -> Length(W)=0 -> (Pointer(W)=nil) or (PLongword(Pointer(W)-4)^=0)
Edited by Sergey Larin

Merge request reports