From cfe845115bccf574e607899014cdbf2d213c6fb0 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Thu, 24 Oct 2013 09:47:16 -0700 Subject: [PATCH] rgw: eliminate one unnecessary case statement 0x21 '!' is the first character that doesn't need encoding, so we can expand the lower bound check. Signed-off-by: Josh Durgin --- src/rgw/rgw_common.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index e51b08889cb9..cb87c18b93d7 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -714,11 +714,10 @@ static void escape_char(char c, string& dst) static bool char_needs_url_encoding(char c) { - if (c < 0x20 || c >= 0x7f) + if (c <= 0x20 || c >= 0x7f) return true; switch (c) { - case 0x20: case 0x22: case 0x23: case 0x25: -- 2.47.3