XPM loader: Minor optimization for cpp > 2

This commit is contained in:
Kim Woelders 2019-11-30 19:21:23 +01:00
parent 269e0b8572
commit 503bce9c64
1 changed files with 2 additions and 5 deletions

View File

@ -354,16 +354,13 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
for (i = 0; count < pixels && i < len - (cpp - 1); for (i = 0; count < pixels && i < len - (cpp - 1);
i += cpp) i += cpp)
{ {
for (j = 0; j < cpp; j++)
col[j] = line[i + j];
col[j] = 0;
for (j = 0; j < ncolors; j++) for (j = 0; j < ncolors; j++)
{ {
if (!strcmp(col, cmap[j].str)) if (memcmp(&line[i], cmap[j].str, cpp) == 0)
{ {
*ptr++ = CMn(j)->pixel; *ptr++ = CMn(j)->pixel;
count++; count++;
j = ncolors; break;
} }
} }
} }