From 8c62cb1c0c3110c044724a4d3f08885632815c94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Brey?= Date: Fri, 5 Aug 2022 12:57:06 +0200 Subject: [PATCH] FileMenuFilter: reorder conditionals for performance (Spotbugs) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Álvaro Brey --- .../java/com/owncloud/android/files/FileMenuFilter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java b/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java index 1ce5bd3655..2db057a824 100644 --- a/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java +++ b/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java @@ -235,7 +235,7 @@ public class FileMenuFilter { private void filterSendFiles(List toShow, List toHide, boolean inSingleFileFragment) { boolean show = true; - if (containsEncryptedFile() || overflowMenu || SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps))) { + if (overflowMenu || SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps)) || containsEncryptedFile()) { show = false; } if (!inSingleFileFragment && (isSingleSelection() || !anyFileDown())) { @@ -321,8 +321,8 @@ public class FileMenuFilter { } private void filterUnsetEncrypted(List toShow, List toHide, boolean endToEndEncryptionEnabled) { - if (files.isEmpty() || !isSingleSelection() || isSingleFile() || !isEncryptedFolder() || hasEncryptedParent() - || !endToEndEncryptionEnabled || !isEmptyFolder()) { + if (!endToEndEncryptionEnabled || files.isEmpty() || !isSingleSelection() || isSingleFile() || !isEncryptedFolder() || hasEncryptedParent() + || !isEmptyFolder()) { toHide.add(R.id.action_unset_encrypted); } else { toShow.add(R.id.action_unset_encrypted);