mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 09:26:15 +02:00
fcl-js: small optimization
git-svn-id: trunk@41154 -
This commit is contained in:
parent
c5331d425a
commit
9aec974448
@ -681,7 +681,7 @@ Var
|
|||||||
p, StartP: Integer;
|
p, StartP: Integer;
|
||||||
MinIndent, CurLineIndent, j, Exp, Code: Integer;
|
MinIndent, CurLineIndent, j, Exp, Code: Integer;
|
||||||
i: SizeInt;
|
i: SizeInt;
|
||||||
D: TJSNumber;
|
D, AsNumber: TJSNumber;
|
||||||
begin
|
begin
|
||||||
if V.CustomValue<>'' then
|
if V.CustomValue<>'' then
|
||||||
begin
|
begin
|
||||||
@ -736,15 +736,17 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
jstNumber :
|
jstNumber :
|
||||||
if (Frac(V.AsNumber)=0)
|
begin
|
||||||
and (V.AsNumber>=double(MinSafeIntDouble))
|
AsNumber:=V.AsNumber;
|
||||||
and (V.AsNumber<=double(MaxSafeIntDouble)) then
|
if (Frac(AsNumber)=0)
|
||||||
|
and (AsNumber>=double(MinSafeIntDouble))
|
||||||
|
and (AsNumber<=double(MaxSafeIntDouble)) then
|
||||||
begin
|
begin
|
||||||
Str(Round(V.AsNumber),S);
|
Str(Round(AsNumber),S);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
Str(V.AsNumber,S);
|
Str(AsNumber,S);
|
||||||
if S[1]=' ' then Delete(S,1,1);
|
if S[1]=' ' then Delete(S,1,1);
|
||||||
i:=Pos('E',S);
|
i:=Pos('E',S);
|
||||||
if (i>2) then
|
if (i>2) then
|
||||||
@ -758,7 +760,7 @@ begin
|
|||||||
if s[j]='.' then inc(j);
|
if s[j]='.' then inc(j);
|
||||||
S2:=LeftStr(S,j)+copy(S,i,length(S));
|
S2:=LeftStr(S,j)+copy(S,i,length(S));
|
||||||
val(S2,D,Code);
|
val(S2,D,Code);
|
||||||
if (Code=0) and (D=V.AsNumber) then
|
if (Code=0) and (D=AsNumber) then
|
||||||
S:=S2;
|
S:=S2;
|
||||||
end;
|
end;
|
||||||
'9':
|
'9':
|
||||||
@ -796,7 +798,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
until false;
|
until false;
|
||||||
val(S2,D,Code);
|
val(S2,D,Code);
|
||||||
if (Code=0) and (D=V.AsNumber) then
|
if (Code=0) and (D=AsNumber) then
|
||||||
S:=S2;
|
S:=S2;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -866,6 +868,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
jstObject : ;
|
jstObject : ;
|
||||||
jstReference : ;
|
jstReference : ;
|
||||||
jstCompletion : ;
|
jstCompletion : ;
|
||||||
|
Loading…
Reference in New Issue
Block a user