FpDebug: clean up char compare (don't use set of char for single char) !310

This commit is contained in:
Martin 2024-08-02 23:14:52 +02:00
parent 0e438a9ef5
commit 06ecb6ff9d

View File

@ -3268,9 +3268,9 @@ end;
procedure TFpValueDwarfSet.SetAsString(AValue: AnsiString);
type
TCharSet = set of char;
function CheckInChar(var p: PChar; c: TCharSet): Boolean;
function CheckAndConsumeChar(var p: PChar; c: Char): Boolean;
begin
Result := p^ in c;
Result := p^ = c;
if Result then
inc(p)
else
@ -3313,7 +3313,7 @@ begin
p := Pchar(AValue);
SkipSpaces(p);
if not CheckInChar(p, ['[']) then
if not CheckAndConsumeChar(p, '[') then
exit;
SkipSpaces(p);
@ -3352,7 +3352,7 @@ begin
SkipSpaces(p);
if p^ = ']' then
break;
if not CheckInChar(p, [',']) then
if not CheckAndConsumeChar(p, ',') then
exit;
SkipSpaces(p);
end;
@ -3392,7 +3392,7 @@ begin
SkipSpaces(p);
if p^ = ']' then
break;
if not CheckInChar(p, [',']) then
if not CheckAndConsumeChar(p, ',') then
exit;
SkipSpaces(p);
end;
@ -3400,10 +3400,10 @@ begin
end;
end;
if not CheckInChar(p, [']']) then
if not CheckAndConsumeChar(p, ']') then
exit;
SkipSpaces(p);
if not CheckInChar(p, [#0]) then
if not CheckAndConsumeChar(p, #0) then
exit;
// we got the value