mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-07 20:50:42 +02:00
* Patch with small speed improvements from Luiz Americo (Bug ID 17240 )
git-svn-id: trunk@15878 -
This commit is contained in:
parent
a848b6fde2
commit
4144176f2f
@ -30,7 +30,7 @@ Type
|
||||
FScanner : TJSONScanner;
|
||||
function ParseNumber: TJSONNumber;
|
||||
Protected
|
||||
procedure DoError(Msg: String);
|
||||
procedure DoError(const Msg: String);
|
||||
function DoParse(AtCurrent,AllowEOF: Boolean): TJSONData;
|
||||
function GetNextToken: TJSONToken;
|
||||
function CurrentTokenString: String;
|
||||
@ -115,8 +115,7 @@ begin
|
||||
tkComma : DoError(SErrUnexpectedToken);
|
||||
end;
|
||||
except
|
||||
if assigned(Result) then
|
||||
FreeAndNil(Result);
|
||||
FreeAndNil(Result);
|
||||
Raise;
|
||||
end;
|
||||
end;
|
||||
@ -226,7 +225,7 @@ begin
|
||||
Until (Result<>tkWhiteSpace);
|
||||
end;
|
||||
|
||||
Procedure TJSONParser.DoError(Msg : String);
|
||||
Procedure TJSONParser.DoError(const Msg : String);
|
||||
|
||||
Var
|
||||
S : String;
|
||||
|
@ -63,7 +63,7 @@ type
|
||||
function DoFetchToken: TJSONToken;
|
||||
public
|
||||
constructor Create(Source : TStream); overload;
|
||||
constructor Create(Source : String); overload;
|
||||
constructor Create(const Source : String); overload;
|
||||
destructor Destroy; override;
|
||||
function FetchToken: TJSONToken;
|
||||
|
||||
@ -104,7 +104,7 @@ begin
|
||||
FSource.LoadFromStream(Source);
|
||||
end;
|
||||
|
||||
constructor TJSONScanner.Create(Source : String);
|
||||
constructor TJSONScanner.Create(const Source : String);
|
||||
begin
|
||||
FSource:=TStringList.Create;
|
||||
FSource.Text:=Source;
|
||||
|
Loading…
Reference in New Issue
Block a user