From 5efdf3ca26303df055a17de5bd0265378d663ddc Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 7 Dec 2016 17:30:21 -0800 Subject: Fix casting error --- src/core/lib/transport/static_metadata.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/core/lib/transport') 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[] = { -- cgit v1.2.3