mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-28 19:06:18 +03:00
fix findRawMode()
and change findMode() to match
This commit is contained in:
parent
b594a756da
commit
5afeb11f9a
|
@ -68,10 +68,9 @@ const Mode * const MODES[] = {
|
|||
};
|
||||
|
||||
const Mode * findMode(const char * const name) {
|
||||
int i = 0;
|
||||
const Mode * mode;
|
||||
while ((mode = MODES[i++]) != NULL) {
|
||||
if (!strcmp(mode->name, name)) {
|
||||
for (int i = 0; (mode = MODES[i]); i++) {
|
||||
if (strcmp(mode->name, name) == 0) {
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
|
@ -434,11 +433,9 @@ const RawMode * const RAWMODES[] = {
|
|||
};
|
||||
|
||||
const RawMode * findRawMode(const char * const name) {
|
||||
int i = 0;
|
||||
const RawMode * rawmode;
|
||||
while ((rawmode = RAWMODES[i++]) != NULL) {
|
||||
const RawMode * const rawmode = RAWMODES[i];
|
||||
if (!strcmp(rawmode->name, name)) {
|
||||
for (int i = 0; (rawmode = RAWMODES[i]); i++) {
|
||||
if (strcmp(rawmode->name, name) == 0) {
|
||||
return rawmode;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user