SpinEx: minor optimization in StrToValue;

git-svn-id: trunk@63723 -
This commit is contained in:
bart 2020-08-11 21:19:21 +00:00
parent 292b94d79c
commit 3169d3729b

View File

@ -350,7 +350,6 @@ end;
function TSpinEditExBase.StrToValue(const S: String): T; function TSpinEditExBase.StrToValue(const S: String): T;
var var
Def, N: T; Def, N: T;
IsNumber: Boolean;
begin begin
{$ifdef debugspinex} {$ifdef debugspinex}
debugln(['TSpinEditExBase.StrToValue: S="',S,'"']); debugln(['TSpinEditExBase.StrToValue: S="',S,'"']);
@ -363,8 +362,7 @@ begin
nvbInitialValue: Def := FInitialValue; nvbInitialValue: Def := FInitialValue;
end; end;
try try
IsNumber := TextIsNumber(S, N); if TextIsNumber(S, N) then
if IsNumber then
Result := N Result := N
else else
Result := Def; Result := Def;