From 91b27e49d66b98d894506e653cbd5272fd776108 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 2 May 2010 22:23:48 +0200 Subject: [PATCH] ffplay: compact expression in compute_mod() Prefer "return X ? Y : Z" over "if (x) return Y; else return Z", reduce line count. Signed-off-by: Stefano Sabatini --- ffplay.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ffplay.c b/ffplay.c index 04e034304a..4b6fe8bb3e 100644 --- a/ffplay.c +++ b/ffplay.c @@ -771,11 +771,7 @@ static void video_image_display(VideoState *is) static inline int compute_mod(int a, int b) { - a = a % b; - if (a >= 0) - return a; - else - return a + b; + return a < 0 ? a%b + b : a%b; } static void video_audio_display(VideoState *s)