From 743241984aa36f0514d0a8e62d1a31764d4fd419 Mon Sep 17 00:00:00 2001 From: pedroluiznogueira Date: Sat, 1 Apr 2023 01:18:47 -0300 Subject: [PATCH] feat: use Optional.ifPresent instead of an if Optional.ifPresent --- .../common/converter/earlybird/BasicIndexingConverter.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/java/com/twitter/search/common/converter/earlybird/BasicIndexingConverter.java b/src/java/com/twitter/search/common/converter/earlybird/BasicIndexingConverter.java index 873b44f7e..2cfc3b986 100644 --- a/src/java/com/twitter/search/common/converter/earlybird/BasicIndexingConverter.java +++ b/src/java/com/twitter/search/common/converter/earlybird/BasicIndexingConverter.java @@ -570,10 +570,8 @@ public class BasicIndexingConverter { if (retweetUserId.isPresent()) { builder.withNativeRetweet(retweetUserId.get(), sharedStatusId.get()); - if (inReplyToUserId.isPresent()) { - // Set IN_REPLY_TO_USER_ID_FIELD even if this is a retweet of a reply. - builder.withInReplyToUserID(inReplyToUserId.get()); - } + // Set IN_REPLY_TO_USER_ID_FIELD even if this is a retweet of a reply. + inReplyToUserId.ifPresent(builder::withInReplyToUserID); } else { // If this is a retweet of a reply, we don't want to mark it as a reply, or override fields // set by the retweet logic.