Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ignore stats prefix for keys without prefix delimiter

  • Loading branch information...
commit b8ff91831829221d57944eafca28cf6420485061 1 parent b1001be
Chang Song authored Trond Norbye committed
Showing with 10 additions and 2 deletions.
  1. +10 −2 stats.c
View
12 stats.c
@@ -68,12 +68,20 @@ static PREFIX_STATS *stats_prefix_find(const char *key, const size_t nkey) {
PREFIX_STATS *pfs;
uint32_t hashval;
size_t length;
+ bool bailout = true;
assert(key != NULL);
- for (length = 0; length < nkey && key[length] != '\0'; length++)
- if (key[length] == settings.prefix_delimiter)
+ for (length = 0; length < nkey && key[length] != '\0'; length++) {
+ if (key[length] == settings.prefix_delimiter) {
+ bailout = false;
break;
+ }
+ }
+
+ if (bailout) {
+ return NULL;
+ }
hashval = hash(key, length, 0) % PREFIX_HASH_SIZE;
Please sign in to comment.
Something went wrong with that request. Please try again.