Back

LL062

String compare without case function

Object Pascal — Delphi & Free Pascal
Info
Delphi

Using LowerCase/UpperCase for comparison allocates a temporary string unnecessarily

using LowerCase/UpperCase for comparison allocates a temporary string unnecessarily.

Why this severity

using LowerCase/UpperCase for comparison allocates a temporary string unnecessarily.


Known false positives

intentional case-normalized storage where the converted value is reused.

Remediation example

if SameText(A, B) then
  DoWork;
// instead of: if LowerCase(A) = LowerCase(B) then

Reconnecting… Connection lost. Reload