mirror of
https://github.com/bol-van/zapret.git
synced 2025-04-19 05:22:58 +03:00
chartree optimizations. x86_32 bin
This commit is contained in:
parent
04bfec0e67
commit
6b51e919a8
BIN
binaries/armhf/tpws
Executable file → Normal file
BIN
binaries/armhf/tpws
Executable file → Normal file
Binary file not shown.
BIN
binaries/mips32r1-lsb/tpws
Executable file → Normal file
BIN
binaries/mips32r1-lsb/tpws
Executable file → Normal file
Binary file not shown.
BIN
binaries/mips32r1-msb/tpws
Executable file → Normal file
BIN
binaries/mips32r1-msb/tpws
Executable file → Normal file
Binary file not shown.
BIN
binaries/x86/nfqws
Normal file
BIN
binaries/x86/nfqws
Normal file
Binary file not shown.
BIN
binaries/x86/tpws
Normal file
BIN
binaries/x86/tpws
Normal file
Binary file not shown.
BIN
binaries/x86_64/tpws
Executable file → Normal file
BIN
binaries/x86_64/tpws
Executable file → Normal file
Binary file not shown.
@ -2,14 +2,6 @@
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static char *DupLower(const char *s)
|
||||
{
|
||||
char *sp,*sl = strdup(s);
|
||||
if (!sl) return false;
|
||||
for(sp=sl;*sp;sp++) *sp=tolower(*sp);
|
||||
return sl;
|
||||
}
|
||||
|
||||
static cptr *CharTreeInit(char c)
|
||||
{
|
||||
cptr *p;
|
||||
@ -19,11 +11,13 @@ static cptr *CharTreeInit(char c)
|
||||
}
|
||||
void CharTreeDestroy(cptr *p)
|
||||
{
|
||||
if (p)
|
||||
cptr *p2;
|
||||
while (p)
|
||||
{
|
||||
CharTreeDestroy(p->leaf);
|
||||
CharTreeDestroy(p->next);
|
||||
free(p);
|
||||
p2 = p;
|
||||
p = p->next;
|
||||
free(p2);
|
||||
}
|
||||
}
|
||||
static cptr *CharTreeFindChar(cptr *p,char c)
|
||||
@ -61,6 +55,14 @@ bool CharTreeCheckStr(cptr *p,const char *s)
|
||||
if (!*s) return true;
|
||||
return CharTreeCheckStr(p->leaf,s+1);
|
||||
}
|
||||
|
||||
static char *DupLower(const char *s)
|
||||
{
|
||||
char *sp,*sl = strdup(s);
|
||||
if (!sl) return false;
|
||||
for(sp=sl;*sp;sp++) *sp=tolower(*sp);
|
||||
return sl;
|
||||
}
|
||||
bool CharTreeAddStrLower(cptr **pp,const char *s)
|
||||
{
|
||||
bool b;
|
||||
|
@ -41,7 +41,8 @@ bool LoadHostList(cptr **hostlist, char *filename)
|
||||
while (fgets(s, 256, F))
|
||||
{
|
||||
for (p = s + strlen(s) - 1; p >= s && (*p == '\r' || *p == '\n'); p--) *p = 0;
|
||||
if (!CharTreeAddStrLower(hostlist, s))
|
||||
for (p = s; *p; p++) *p=tolower(*p);
|
||||
if (!CharTreeAddStr(hostlist, s))
|
||||
{
|
||||
CharTreeDestroy(*hostlist);
|
||||
*hostlist = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user