Re: Fastcode CharPosIEx B&V 1.0.2
- From: "Dennis" <marianndkc@xxxxxxxxxxxxxxx>
- Date: Tue, 14 Nov 2006 20:45:19 +0100
Hi
Now open the CPU view and observe that LStrLen is called once for every loop
iteration. The compiler should have been smart enough to observe that it is
loop invariant.
//while Index <= Length(S) do
mov eax,edi
call @LStrLen
cmp esi,eax
jle $0047a42c
We can code it like this
function CharPosIEx_NN_Pas_4_a(SearchChar : Char; const S: string; Offset:
Integer = 1) : Integer;
var
UpperSearchChar : Char;
Index, LengthS : Integer;
begin
Result := 0;
UpperSearchChar := UpCase_NN_Pas_1(SearchChar);
LengthS := Length(S);
Index := Offset;
if Index > 0 then
begin
while Index <= LengthS do
begin
if UpCase_NN_Pas_1(S[Index]) = UpperSearchChar then
begin
//We have a match
Result := Index;
Break;
end;
Inc(Index);
end;
end;
end;
Best regards
Dennis Kjaer Christensen
----------------------------------------------------------------------------
----
Jeg beskyttes af den gratis SPAMfighter til privatbrugere.
Den har indtil videre sparet mig for at få 5359 spam-mails
Betalende brugere får ikke denne besked i deres e-mails.
Hent en gratis SPAMfighter her.
.
- Follow-Ups:
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- References:
- Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Re: Fastcode CharPosIEx B&V 1.0.2
- From: Dennis
- Fastcode CharPosIEx B&V 1.0.2
- Prev by Date: Re: Fastcode CharPosIEx B&V 1.0.2
- Next by Date: Re: Fastcode CharPosIEx B&V 1.0.2
- Previous by thread: Re: Fastcode CharPosIEx B&V 1.0.2
- Next by thread: Re: Fastcode CharPosIEx B&V 1.0.2
- Index(es):
Relevant Pages
|