From 6914dafd6ca89f9c1a229e10540930e6c9abfe64 Mon Sep 17 00:00:00 2001 From: John Sully Date: Sun, 10 Feb 2019 19:31:46 -0500 Subject: [PATCH] Prevent so many copies of sdslen getting added Former-commit-id: 327bbec981feb0d90df416281575953cd71ef6c2 --- deps/hiredis/sds.h | 2 +- src/sds.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps/hiredis/sds.h b/deps/hiredis/sds.h index 6b46297c2..404f246c4 100644 --- a/deps/hiredis/sds.h +++ b/deps/hiredis/sds.h @@ -83,7 +83,7 @@ struct __attribute__ ((__packed__)) sdshdr64 { #define SDS_HDR(T,s) ((struct sdshdr##T *)((s)-(sizeof(struct sdshdr##T)))) #define SDS_TYPE_5_LEN(f) ((f)>>SDS_TYPE_BITS) -static inline size_t sdslen(const sds s) { +inline size_t sdslen(const sds s) { unsigned char flags = s[-1]; switch(__builtin_expect((flags&SDS_TYPE_MASK), SDS_TYPE_5)) { diff --git a/src/sds.h b/src/sds.h index 3144dced8..e4090d23a 100644 --- a/src/sds.h +++ b/src/sds.h @@ -90,7 +90,7 @@ struct __attribute__ ((__packed__)) sdshdr64 { #define SDS_HDR(T,s) ((struct sdshdr##T *)((s)-(sizeof(struct sdshdr##T)))) #define SDS_TYPE_5_LEN(f) ((f)>>SDS_TYPE_BITS) -static inline size_t sdslen(const sds s) { +inline size_t sdslen(const sds s) { unsigned char flags = s[-1]; int type = flags & SDS_TYPE_MASK;