From e564f95aa88df963fc3560ecd241389861a19723 Mon Sep 17 00:00:00 2001 From: jrhee17 Date: Mon, 18 Nov 2024 16:54:39 +0900 Subject: [PATCH] remove unnecessary checks --- .../armeria/common/logging/DefaultRequestLog.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/core/src/main/java/com/linecorp/armeria/common/logging/DefaultRequestLog.java b/core/src/main/java/com/linecorp/armeria/common/logging/DefaultRequestLog.java index e4a7d804371..250eed2fae3 100644 --- a/core/src/main/java/com/linecorp/armeria/common/logging/DefaultRequestLog.java +++ b/core/src/main/java/com/linecorp/armeria/common/logging/DefaultRequestLog.java @@ -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 @@ -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() {