From: Matthew Fernandez Date: Sun, 31 May 2020 21:07:38 +0000 (-0700) Subject: remove micro-optimization in MEMCPY X-Git-Tag: 2.44.1~13^2^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3830ece2902c4eb8c535c23e54816c07516e22ca;p=graphviz remove micro-optimization in MEMCPY This optimization for short memcpys can be performed by the compiler and/or libc these days. Related to #1723. --- diff --git a/lib/sfio/sfhdr.h b/lib/sfio/sfhdr.h index 7ebb4acce..265b69526 100644 --- a/lib/sfio/sfhdr.h +++ b/lib/sfio/sfhdr.h @@ -735,16 +735,7 @@ extern "C" { /* note that MEMCPY advances the associated pointers */ #define MEMCPY(to,fr,n) \ - switch(n) \ - { default : memcpy((void*)to,(void*)fr,n); to += n; fr += n; break; \ - case 7 : *to++ = *fr++; \ - case 6 : *to++ = *fr++; \ - case 5 : *to++ = *fr++; \ - case 4 : *to++ = *fr++; \ - case 3 : *to++ = *fr++; \ - case 2 : *to++ = *fr++; \ - case 1 : *to++ = *fr++; \ - } + do { memcpy((void*)to,(void*)fr,n); to += n; fr += n; } while (0) extern Sfextern_t _Sfextern; extern Sftab_t _Sftable;