diff options
author | Yuchen Zeng <zyc@google.com> | 2017-08-25 14:09:47 -0700 |
---|---|---|
committer | Yuchen Zeng <zyc@google.com> | 2017-08-25 14:09:47 -0700 |
commit | 6514a0df72d9425ae5058eab6dd120179b2105d1 (patch) | |
tree | 7d90edf6082a2a96ce06549a2679bf959e468732 /src/core/lib/iomgr | |
parent | ba23e799dc1c4ea5f6c0139bf95cd04e0794e714 (diff) |
Add gpr_is_true
Diffstat (limited to 'src/core/lib/iomgr')
-rw-r--r-- | src/core/lib/iomgr/iomgr.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/lib/iomgr/iomgr.c b/src/core/lib/iomgr/iomgr.c index 3d19953eeb..003ff9a21d 100644 --- a/src/core/lib/iomgr/iomgr.c +++ b/src/core/lib/iomgr/iomgr.c @@ -164,13 +164,7 @@ void grpc_iomgr_unregister_object(grpc_iomgr_object *obj) { bool grpc_iomgr_abort_on_leaks(void) { char *env = gpr_getenv("GRPC_ABORT_ON_LEAKS"); - if (env == NULL) return false; - static const char *truthy[] = {"yes", "Yes", "YES", "true", - "True", "TRUE", "1"}; - bool should_we = false; - for (size_t i = 0; i < GPR_ARRAY_SIZE(truthy); i++) { - if (0 == strcmp(env, truthy[i])) should_we = true; - } - gpr_free(env); + bool should_we = gpr_is_true(env); + grp_free(env); return should_we; } |