mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 00:29:33 +02:00
* Avoid memory allocation in IsNullOrWhitespace. Fix issue #39702
This commit is contained in:
parent
beb97b8110
commit
cab37732c4
@ -311,8 +311,15 @@ end;
|
||||
|
||||
|
||||
class function TStringHelper.IsNullOrWhiteSpace(const AValue: string): Boolean;
|
||||
const
|
||||
LWhiteSpace = [#0..' '];
|
||||
var
|
||||
I: SizeInt;
|
||||
begin
|
||||
Result:=system.Length(SysUtils.Trim(AValue))=0;
|
||||
for I:=1 to System.Length(AValue) do
|
||||
if not (AValue[I] in LWhiteSpace) then
|
||||
exit(False);
|
||||
Result:=True;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user