From: Dirk Mueller Date: Tue, 27 May 2003 00:21:30 +0000 (+0000) Subject: minor code simplification X-Git-Tag: svn/VALGRIND_2_0_0~128 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=daf6538cd965c8e0956985ca87d9186ed00d5319;p=thirdparty%2Fvalgrind.git minor code simplification git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1656 --- diff --git a/memcheck/mc_replace_strmem.c b/memcheck/mc_replace_strmem.c index cbe1ad8b91..7c52e94e33 100644 --- a/memcheck/mc_replace_strmem.c +++ b/memcheck/mc_replace_strmem.c @@ -47,12 +47,8 @@ static __inline__ Bool is_overlap ( void* dst, const void* src, UInt len ) { - Int diff = src-dst; - - if (diff < 0) - diff = -diff; - /* Now we have diff >= 0, so a cast to UInt is harmless. */ - return ( ((UInt)diff) < len); + UInt diff = src > dst ? src-dst : dst-src; + return (diff < len); } static __inline__