[Off] strcmp veloz
#2

Minha versгo:
pawn Код:
istrcmp(str[], str2[], bool: per = true){

    if(strlen(str) > strlen(str2)) return -1;
    if(strlen(str) < strlen(str2)) return 1;

    if(!per){
        for(new i; str[i]; ++i){
            if(str[i] != str2[i]){
                return false;
            }
        }
    }else{
        for(new i; str[i]; ++i){
            if(tolower(str[i]) != (str2[i])){
                return false;
            }
        }
    }
    return true;
}
Inclue todas as funзхes da strcmp nativa.


Testes:
Код:
[02:50:42]  Bench for SA-MP: executes, by average, 352.10 times/ms.
[02:50:44]  Bench for SuYaNw: executes, by average, 1892.96 times/ms.
Reply


Messages In This Thread
strcmp veloz - by ipsBruno - 30.09.2013, 05:26
Re: strcmp veloz - by zSuYaNw - 30.09.2013, 05:45
Re: strcmp veloz - by ipsBruno - 30.09.2013, 05:46
Re: strcmp veloz - by zSuYaNw - 30.09.2013, 05:50
Re: strcmp veloz - by ipsBruno - 30.09.2013, 05:54
Re: strcmp veloz - by ipsBruno - 30.09.2013, 06:15
Re: strcmp veloz - by zSuYaNw - 30.09.2013, 06:19
Re: strcmp veloz - by ipsBruno - 30.09.2013, 06:21
Re: strcmp veloz - by zSuYaNw - 30.09.2013, 06:22
Re: strcmp veloz - by ipsBruno - 30.09.2013, 06:25

Forum Jump:


Users browsing this thread: 2 Guest(s)