fix: LGTM warning/alert (#601)

* fix: LGTM warning

* fix: change requested
This commit is contained in:
David Leal 2020-09-09 17:54:16 -05:00 committed by GitHub
parent e75d0e75d7
commit 3052511c14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -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;