mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 22:41:42 +02:00
FpDebug: clean up char compare (don't use set of char
for single char
) !310
This commit is contained in:
parent
0e438a9ef5
commit
06ecb6ff9d
@ -3268,9 +3268,9 @@ end;
|
|||||||
procedure TFpValueDwarfSet.SetAsString(AValue: AnsiString);
|
procedure TFpValueDwarfSet.SetAsString(AValue: AnsiString);
|
||||||
type
|
type
|
||||||
TCharSet = set of char;
|
TCharSet = set of char;
|
||||||
function CheckInChar(var p: PChar; c: TCharSet): Boolean;
|
function CheckAndConsumeChar(var p: PChar; c: Char): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := p^ in c;
|
Result := p^ = c;
|
||||||
if Result then
|
if Result then
|
||||||
inc(p)
|
inc(p)
|
||||||
else
|
else
|
||||||
@ -3313,7 +3313,7 @@ begin
|
|||||||
|
|
||||||
p := Pchar(AValue);
|
p := Pchar(AValue);
|
||||||
SkipSpaces(p);
|
SkipSpaces(p);
|
||||||
if not CheckInChar(p, ['[']) then
|
if not CheckAndConsumeChar(p, '[') then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
SkipSpaces(p);
|
SkipSpaces(p);
|
||||||
@ -3352,7 +3352,7 @@ begin
|
|||||||
SkipSpaces(p);
|
SkipSpaces(p);
|
||||||
if p^ = ']' then
|
if p^ = ']' then
|
||||||
break;
|
break;
|
||||||
if not CheckInChar(p, [',']) then
|
if not CheckAndConsumeChar(p, ',') then
|
||||||
exit;
|
exit;
|
||||||
SkipSpaces(p);
|
SkipSpaces(p);
|
||||||
end;
|
end;
|
||||||
@ -3392,7 +3392,7 @@ begin
|
|||||||
SkipSpaces(p);
|
SkipSpaces(p);
|
||||||
if p^ = ']' then
|
if p^ = ']' then
|
||||||
break;
|
break;
|
||||||
if not CheckInChar(p, [',']) then
|
if not CheckAndConsumeChar(p, ',') then
|
||||||
exit;
|
exit;
|
||||||
SkipSpaces(p);
|
SkipSpaces(p);
|
||||||
end;
|
end;
|
||||||
@ -3400,10 +3400,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
if not CheckInChar(p, [']']) then
|
if not CheckAndConsumeChar(p, ']') then
|
||||||
exit;
|
exit;
|
||||||
SkipSpaces(p);
|
SkipSpaces(p);
|
||||||
if not CheckInChar(p, [#0]) then
|
if not CheckAndConsumeChar(p, #0) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
// we got the value
|
// we got the value
|
||||||
|
Loading…
Reference in New Issue
Block a user