mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 04:32:05 +02:00
* Don't do useless string case conversions in a loop.
git-svn-id: trunk@33077 -
This commit is contained in:
parent
2861362780
commit
55492a0f30
@ -493,14 +493,13 @@ Interface
|
|||||||
function TMipsReader.is_asmopcode(const s: string):boolean;
|
function TMipsReader.is_asmopcode(const s: string):boolean;
|
||||||
var
|
var
|
||||||
cond:TAsmCond;
|
cond:TAsmCond;
|
||||||
|
hs:string;
|
||||||
Begin
|
Begin
|
||||||
{ making s a value parameter would break other assembler readers }
|
|
||||||
is_asmopcode:=false;
|
is_asmopcode:=false;
|
||||||
|
|
||||||
{ clear op code }
|
{ clear op code and condition }
|
||||||
actopcode:=A_None;
|
actopcode:=A_None;
|
||||||
{ clear condition }
|
actcondition:=C_None;
|
||||||
fillchar(actcondition,sizeof(actcondition),0);
|
|
||||||
|
|
||||||
{ Search opcodes }
|
{ Search opcodes }
|
||||||
actopcode:=tasmop(PtrUInt(iasmops.Find(s)));
|
actopcode:=tasmop(PtrUInt(iasmops.Find(s)));
|
||||||
@ -517,8 +516,9 @@ Interface
|
|||||||
{ we can search here without an extra table which is sorted by string length
|
{ we can search here without an extra table which is sorted by string length
|
||||||
because we take the whole remaining string without the leading B }
|
because we take the whole remaining string without the leading B }
|
||||||
actopcode := A_BC;
|
actopcode := A_BC;
|
||||||
|
hs:=lower(copy(s,2,maxint));
|
||||||
for cond:=low(TAsmCond) to high(TAsmCond) do
|
for cond:=low(TAsmCond) to high(TAsmCond) do
|
||||||
if (Upper(copy(s,2,length(s)-1))=Upper(Cond2Str[cond])) then
|
if (hs=Cond2Str[cond]) then
|
||||||
begin
|
begin
|
||||||
actasmtoken:=AS_OPCODE;
|
actasmtoken:=AS_OPCODE;
|
||||||
actcondition:=cond;
|
actcondition:=cond;
|
||||||
|
Loading…
Reference in New Issue
Block a user