From 8d76fc71323fadefb6dd9dbe6f1851b4391609dc Mon Sep 17 00:00:00 2001 From: ZhangCheng Date: Fri, 29 Nov 2024 19:44:23 +0800 Subject: [PATCH] Simplify find query encryptor method (#33842) --- .../shardingsphere/encrypt/rule/table/EncryptTable.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/table/EncryptTable.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/table/EncryptTable.java index 629649cde021c..646e4b02efd43 100644 --- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/table/EncryptTable.java +++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/rule/table/EncryptTable.java @@ -176,9 +176,6 @@ public boolean isLikeQueryColumn(final String columnName) { */ @HighFrequencyInvocation public Optional findQueryEncryptor(final String columnName) { - if (!isEncryptColumn(columnName)) { - return Optional.empty(); - } - return Optional.of(getEncryptColumn(columnName).getQueryEncryptor()); + return isEncryptColumn(columnName) ? Optional.of(getEncryptColumn(columnName).getQueryEncryptor()) : Optional.empty(); } }