From 1d6ae8e9084650b1386d22c58fdaad973e927c3f Mon Sep 17 00:00:00 2001
From: "Stephen R. van den Berg" <srb@cuci.nl>
Date: Tue, 9 Sep 2014 01:08:43 +0200
Subject: [PATCH] Faster code.

---
 src/stralloc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/stralloc.c b/src/stralloc.c
index 8ea89e94df..62ddeccfcf 100644
--- a/src/stralloc.c
+++ b/src/stralloc.c
@@ -231,12 +231,9 @@ static INLINE int find_magnitude2(const p_wchar2 *s, ptrdiff_t len)
   return 0;
 }
 
-static INLINE int min_magnitude(const p_wchar2 c)
+static INLINE unsigned min_magnitude(const unsigned c)
 {
-  if(c<0) return 2;
-  if(c<256) return 0;
-  if(c<65536) return 1;
-  return 2;
+  return c<256 ? 0 : c<65536 ? 1 : 2;
 }
 
 void low_set_index(struct pike_string *s, ptrdiff_t pos, int value)
-- 
GitLab