aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/transport
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-12-07 17:30:21 -0800
committerGravatar Craig Tiller <ctiller@google.com>2016-12-07 17:30:21 -0800
commit5efdf3ca26303df055a17de5bd0265378d663ddc (patch)
tree57039c5df9fe1885903df59f6cfa5e149dc38974 /src/core/lib/transport
parent3153e5af0cda0755d927f281f6561eb52279ced1 (diff)
Fix casting error
Diffstat (limited to 'src/core/lib/transport')
-rw-r--r--src/core/lib/transport/static_metadata.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/lib/transport/static_metadata.c b/src/core/lib/transport/static_metadata.c
index 807adfef54..5adc3216c9 100644
--- a/src/core/lib/transport/static_metadata.c
+++ b/src/core/lib/transport/static_metadata.c
@@ -440,7 +440,12 @@ static uint32_t elems_phash(uint32_t i) {
i -= 42;
uint32_t x = i % 96;
uint32_t y = i / 96;
- return y < GPR_ARRAY_SIZE(elems_r) ? x + (uint32_t)elems_r[y] : 0;
+ uint32_t h = x;
+ if (y < GPR_ARRAY_SIZE(elems_r)) {
+ uint32_t delta = (uint32_t)elems_r[y];
+ h += delta;
+ }
+ return h;
}
static const uint16_t elem_keys[] = {