Skip to content

Commit

Permalink
remove unnecessary checks
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhee17 committed Nov 18, 2024
1 parent 53de68b commit e564f95
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -992,11 +992,7 @@ public void requestContent(@Nullable Object requestContent, @Nullable Object raw
ctx.updateRpcRequest((RpcRequest) requestContent);
}
updateFlags(RequestLogProperty.REQUEST_CONTENT);

final int requestCompletionFlags = RequestLogProperty.FLAGS_REQUEST_COMPLETE & ~deferredFlags;
if (isAvailable(requestCompletionFlags)) {
setNamesIfAbsent();
}
setNamesIfAbsent();
}

@Nullable
Expand Down Expand Up @@ -1118,14 +1114,6 @@ private void endRequest0(@Nullable Throwable requestCause, long requestEndTimeNa
this.requestCause = requestCause;
}
updateFlags(flags);

// The check here covers two cases:
// 1) #endRequest has completed all flags except name.
// 2) #requestContent has been called from a different thread, but names hasn't been set
if (hasInterestedFlags(deferredFlags, RequestLogProperty.REQUEST_CONTENT) &&
isAvailable(RequestLogProperty.REQUEST_CONTENT)) {
setNamesIfAbsent();
}
}

private void setNamesIfAbsent() {
Expand Down

0 comments on commit e564f95

Please sign in to comment.