From: helloguo Date: Tue, 28 Jul 2020 05:08:52 +0000 (-0700) Subject: Optimize ZSTD_wildcopy X-Git-Tag: v1.4.7~105^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82b0cd844f833f3e0488356b38410ef65417a278;p=thirdparty%2Fzstd.git Optimize ZSTD_wildcopy --- diff --git a/lib/common/zstd_internal.h b/lib/common/zstd_internal.h index ee3cb51bf..557ae60d4 100644 --- a/lib/common/zstd_internal.h +++ b/lib/common/zstd_internal.h @@ -290,8 +290,10 @@ void ZSTD_wildcopy(void* dst, const void* src, ptrdiff_t length, ZSTD_overlap_e } while (op < oend); #else - COPY16(op, ip); - if (op >= oend) return; + memcpy(op, ip, 16); + if (16 >= length) return; + op += 16; + ip += 16; do { COPY16(op, ip); COPY16(op, ip);