Incrementing pointer *pr once is faster than computing reject[j] for each time we need it.
Signed-off-by: Jose Da Silva <digi...@joescat.com> --- libavcodec/xpmdec.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libavcodec/xpmdec.c b/libavcodec/xpmdec.c index 92a568041c..be5277e637 100644 --- a/libavcodec/xpmdec.c +++ b/libavcodec/xpmdec.c @@ -211,7 +211,8 @@ static unsigned int hex_char_to_number(uint8_t x) */ static size_t mod_strcspn(const char *string, const char *reject) { - int i, j; + const char *pr; + int i; if (string == 0) return 0; @@ -226,11 +227,8 @@ static size_t mod_strcspn(const char *string, const char *reject) while (string[i] && string[i] != '\n') i++; } else if (reject) { - for (j = 0; reject[j]; j++) { - if (string[i] == reject[j]) - break; - } - if (reject[j]) + for (pr = reject; *pr && *pr != string[i]; pr++); + if (*pr) break; } } -- 2.30.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".