]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: eliminate one unnecessary case statement
authorJosh Durgin <josh.durgin@inktank.com>
Thu, 24 Oct 2013 16:47:16 +0000 (09:47 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Thu, 24 Oct 2013 18:37:07 +0000 (11:37 -0700)
0x21 '!' is the first character that doesn't need encoding, so we can
expand the lower bound check.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/rgw/rgw_common.cc

index e51b08889cb96278bce4eba09837aafcd861cc43..cb87c18b93d71898c55cd52cab51969dbeb0ffd4 100644 (file)
@@ -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: