changeset 7829:7640294af313 libavcodec

Simplify if() in copy_and_dup()
author vitor
date Mon, 08 Sep 2008 18:16:00 +0000
parents 0dc972a25a37
children 3da762190370
files ra144.c
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ra144.c	Mon Sep 08 18:14:37 2008 +0000
+++ b/ra144.c	Mon Sep 08 18:16:00 2008 +0000
@@ -109,12 +109,9 @@
 {
     source += BUFFERSIZE - offset;
 
-    if (offset > BLOCKSIZE) {
-        memcpy(target, source, BLOCKSIZE*sizeof(*target));
-    } else {
-        memcpy(target, source, offset*sizeof(*target));
+    memcpy(target, source, FFMIN(BLOCKSIZE, offset)*sizeof(*target));
+    if (offset < BLOCKSIZE)
         memcpy(target + offset, source, (BLOCKSIZE - offset)*sizeof(*target));
-    }
 }
 
 /** inverse root mean square */