From 42c636c9722f64fe6290ea8eee13658d25f5fbe3 Mon Sep 17 00:00:00 2001 From: Jose Da Silva Date: Sun, 31 Jan 2021 19:50:57 -0800 Subject: avcodec/xbmenc: Pre-compute variables once for parse_str_int() Some compilers are very intuitive, and others are not so much, so let's pre-compute the variables e and keylen outside the for loop. Ensuring a minor speed increase regardless of if compiler is smart enough to solve this improvement for itself, or not. Signed-off-by: Joe Da Silva --- libavcodec/xbmdec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libavcodec/xbmdec.c') diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c index 2ce70204cf..b783d5abe5 100644 --- a/libavcodec/xbmdec.c +++ b/libavcodec/xbmdec.c @@ -39,11 +39,14 @@ static int convert(uint8_t x) static int parse_str_int(const uint8_t *p, const uint8_t *end, const uint8_t *key) { - for(; p= end) return INT_MIN; -- cgit v1.2.3