prepare v1.1.4
[awesomized/libmemcached] / src / libhashkit / jenkins.cc
index b07509b9529dd51a527c6df6bf268535a4288a96..1503168f2086fc9f5f5216121002be8aaa45fda6 100644 (file)
@@ -1,6 +1,6 @@
 /*
     +--------------------------------------------------------------------+
-    | libmemcached - C/C++ Client Library for memcached                  |
+    | libmemcached-awesome - C/C++ Client Library for memcached          |
     +--------------------------------------------------------------------+
     | Redistribution and use in source and binary forms, with or without |
     | modification, are permitted under the terms of the BSD license.    |
@@ -9,7 +9,7 @@
     | the terms online at: https://opensource.org/licenses/BSD-3-Clause  |
     +--------------------------------------------------------------------+
     | Copyright (c) 2006-2014 Brian Aker   https://datadifferential.com/ |
-    | Copyright (c) 2020 Michael Wallner   <mike@php.net>                |
+    | Copyright (c) 2020-2021 Michael Wallner        https://awesome.co/ |
     +--------------------------------------------------------------------+
 */
 
@@ -155,12 +155,22 @@ hashkit_jenkins(const char *key, size_t length, void *) {
       b += k[1] & 0xff;
       a += k[0];
       break;
-    case 4: a += k[0]; break;
-    case 3: a += k[0] & 0xffffff; break;
-    case 2: a += k[0] & 0xffff; break;
-    case 1: a += k[0] & 0xff; break;
-    case 0: return c; /* zero length strings require no mixing */
-    default: return c;
+    case 4:
+      a += k[0];
+      break;
+    case 3:
+      a += k[0] & 0xffffff;
+      break;
+    case 2:
+      a += k[0] & 0xffff;
+      break;
+    case 1:
+      a += k[0] & 0xff;
+      break;
+    case 0:
+      return c; /* zero length strings require no mixing */
+    default:
+      return c;
     }
 
   } else if ((u.i & 0x1) == 0) {
@@ -210,14 +220,22 @@ hashkit_jenkins(const char *key, size_t length, void *) {
     case 5:
       b += k8[4];
       /* fall through */
-    case 4: a += k[0] + (((uint32_t) k[1]) << 16); break;
+    case 4:
+      a += k[0] + (((uint32_t) k[1]) << 16);
+      break;
     case 3:
       a += ((uint32_t) k8[2]) << 16;
       /* fall through */
-    case 2: a += k[0]; break;
-    case 1: a += k8[0]; break;
-    case 0: return c; /* zero length requires no mixing */
-    default: return c;
+    case 2:
+      a += k[0];
+      break;
+    case 1:
+      a += k8[0];
+      break;
+    case 0:
+      return c; /* zero length requires no mixing */
+    default:
+      return c;
     }
 
   } else { /* need to read the key one byte at a time */
@@ -278,9 +296,13 @@ hashkit_jenkins(const char *key, size_t length, void *) {
     case 2:
       a += ((uint32_t) k[1]) << 8;
       /* fall through */
-    case 1: a += k[0]; break;
-    case 0: return c;
-    default: return c;
+    case 1:
+      a += k[0];
+      break;
+    case 0:
+      return c;
+    default:
+      return c;
     }
 #if !WORDS_BIGENDIAN
   }