mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
fix: LGTM warning/alert (#601)
* fix: LGTM warning * fix: change requested
This commit is contained in:
parent
e75d0e75d7
commit
3052511c14
@ -244,7 +244,7 @@ void cleanup1(Tptr p)
|
|||||||
// Insert 2 -- Faster version of Insert
|
// Insert 2 -- Faster version of Insert
|
||||||
|
|
||||||
#define BUFSIZE 1000
|
#define BUFSIZE 1000
|
||||||
Tptr buf;
|
Tptr buffer;
|
||||||
int bufn, freen;
|
int bufn, freen;
|
||||||
void *freearr[10000];
|
void *freearr[10000];
|
||||||
int storestring = 0;
|
int storestring = 0;
|
||||||
@ -256,6 +256,7 @@ void insert2(char *s)
|
|||||||
|
|
||||||
Tptr pp, *p;
|
Tptr pp, *p;
|
||||||
p = &root;
|
p = &root;
|
||||||
|
pp = *p;
|
||||||
while (pp == *p)
|
while (pp == *p)
|
||||||
{
|
{
|
||||||
if ((d = *s - pp->splitchar) == 0)
|
if ((d = *s - pp->splitchar) == 0)
|
||||||
@ -274,11 +275,11 @@ void insert2(char *s)
|
|||||||
// *p = (Tptr) malloc(sizeof(Tnode));
|
// *p = (Tptr) malloc(sizeof(Tnode));
|
||||||
if (bufn-- == 0)
|
if (bufn-- == 0)
|
||||||
{
|
{
|
||||||
buf = (Tptr)malloc(BUFSIZE * sizeof(Tnode));
|
buffer = (Tptr)malloc(BUFSIZE * sizeof(Tnode));
|
||||||
freearr[freen++] = (void *)buf;
|
freearr[freen++] = (void *)buffer;
|
||||||
bufn = BUFSIZE - 1;
|
bufn = BUFSIZE - 1;
|
||||||
}
|
}
|
||||||
*p = buf++;
|
*p = buffer++;
|
||||||
pp = *p;
|
pp = *p;
|
||||||
pp->splitchar = *s;
|
pp->splitchar = *s;
|
||||||
pp->lokid = pp->eqkid = pp->hikid = 0;
|
pp->lokid = pp->eqkid = pp->hikid = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user