diff options
author | Craig Tiller <ctiller@google.com> | 2017-03-14 07:59:19 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-03-14 07:59:19 -0700 |
commit | 82d72e79dfb1f1e59844c7b6d5826a726b84e631 (patch) | |
tree | 01eeeba16f88f7e875254add08ff45196f55460a /src/core/lib/transport | |
parent | b18c8ba0b6bbc2317dd92353288f2b1c0ff353d5 (diff) | |
parent | 264a2108788fde232dfec976a511ed732864ddb0 (diff) |
Merge github.com:grpc/grpc into nolock
Diffstat (limited to 'src/core/lib/transport')
-rw-r--r-- | src/core/lib/transport/error_utils.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/core/lib/transport/error_utils.c b/src/core/lib/transport/error_utils.c index da77828d9c..ef55e561fb 100644 --- a/src/core/lib/transport/error_utils.c +++ b/src/core/lib/transport/error_utils.c @@ -44,12 +44,12 @@ static grpc_error *recursively_find_error_with_field(grpc_error *error, } if (grpc_error_is_special(error)) return NULL; // Otherwise, search through its children. - intptr_t key = 0; - while (true) { - grpc_error *child_error = gpr_avl_get(error->errs, (void *)key++); - if (child_error == NULL) break; - grpc_error *result = recursively_find_error_with_field(child_error, which); - if (result != NULL) return result; + uint8_t slot = error->first_err; + while (slot != UINT8_MAX) { + grpc_linked_error *lerr = (grpc_linked_error *)(error->arena + slot); + grpc_error *result = recursively_find_error_with_field(lerr->err, which); + if (result) return result; + slot = lerr->next; } return NULL; } @@ -112,13 +112,13 @@ bool grpc_error_has_clear_grpc_status(grpc_error *error) { if (grpc_error_get_int(error, GRPC_ERROR_INT_GRPC_STATUS, NULL)) { return true; } - intptr_t key = 0; - while (true) { - grpc_error *child_error = gpr_avl_get(error->errs, (void *)key++); - if (child_error == NULL) break; - if (grpc_error_has_clear_grpc_status(child_error)) { + uint8_t slot = error->first_err; + while (slot != UINT8_MAX) { + grpc_linked_error *lerr = (grpc_linked_error *)(error->arena + slot); + if (grpc_error_has_clear_grpc_status(lerr->err)) { return true; } + slot = lerr->next; } return false; } |