Move constant strlen call outside of loop code
This commit is contained in:
5
exebuf.c
5
exebuf.c
@ -151,7 +151,7 @@ static pDynString findBlockEnd(pExeBuf self)
|
||||
{
|
||||
pDynString command = NULL;
|
||||
char *buffer = NULL;
|
||||
int i;
|
||||
int i, j;
|
||||
|
||||
assert(self);
|
||||
|
||||
@ -163,7 +163,8 @@ static pDynString findBlockEnd(pExeBuf self)
|
||||
if (self->end != -1) {
|
||||
self->start = self->end + 1;
|
||||
}
|
||||
for (i = self->start; i < strlen(buffer); i++) {
|
||||
j = strlen(buffer);
|
||||
for (i = self->start; i < j; i++) {
|
||||
DynStringConcatChar(command, buffer[i]);
|
||||
if (buffer[i] == '\n') {
|
||||
self->lineno++;
|
||||
|
Reference in New Issue
Block a user