You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/12/17 19:21:18 UTC
(commons-email) 02/03: Use ternary expression
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-email.git
commit 84bfcd8991c74185058c76ffda5c410d5e180235
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Dec 17 13:42:56 2023 -0500
Use ternary expression
---
src/main/java/org/apache/commons/mail/util/MimeMessageParser.java | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/mail/util/MimeMessageParser.java b/src/main/java/org/apache/commons/mail/util/MimeMessageParser.java
index 3264433..f696e7c 100644
--- a/src/main/java/org/apache/commons/mail/util/MimeMessageParser.java
+++ b/src/main/java/org/apache/commons/mail/util/MimeMessageParser.java
@@ -146,10 +146,7 @@ public class MimeMessageParser {
*/
private String getBaseMimeType(final String fullMimeType) {
final int pos = fullMimeType.indexOf(';');
- if (pos >= 0) {
- return fullMimeType.substring(0, pos);
- }
- return fullMimeType;
+ return pos < 0 ? fullMimeType : fullMimeType.substring(0, pos);
}
/**