From 4e24b0e4dce7cdd9f45ee0e2178721f08cfed86a Mon Sep 17 00:00:00 2001 From: Arjun Roy Date: Thu, 18 Apr 2019 17:53:56 -0700 Subject: [PATCH] Bugfix - fixed assumptions --- src/core/lib/transport/metadata.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/lib/transport/metadata.h b/src/core/lib/transport/metadata.h index b58189fb2bf..949870f2a89 100644 --- a/src/core/lib/transport/metadata.h +++ b/src/core/lib/transport/metadata.h @@ -126,10 +126,6 @@ grpc_mdelem grpc_mdelem_create( bool grpc_mdelem_eq(grpc_mdelem a, grpc_mdelem b); -inline bool grpc_mdelem_eq_static(grpc_mdelem a_static, grpc_mdelem b_static) { - return a_static.payload == b_static.payload; -} - /* Mutator and accessor for grpc_mdelem user data. The destructor function is used as a type tag and is checked during user_data fetch. */ void* grpc_mdelem_get_user_data(grpc_mdelem md, void (*if_destroy_func)(void*)); @@ -164,4 +160,9 @@ void grpc_mdelem_unref(grpc_mdelem md); void grpc_mdctx_global_init(void); void grpc_mdctx_global_shutdown(); +inline bool grpc_mdelem_eq_static(grpc_mdelem a_static, grpc_mdelem b_static) { + if (a_static.payload == b_static.payload) return true; + return grpc_slice_eq(GRPC_MDVALUE(a_static), GRPC_MDVALUE(b_static)); +} + #endif /* GRPC_CORE_LIB_TRANSPORT_METADATA_H */