This is an automated email from the ASF dual-hosted git repository.
orpiske pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 819af87490e (chores) core/camel-util: use isEmpty as it is cleaner and
faster
819af87490e is described below
commit 819af87490e0d8fb60e645616ea6fd2315e6caf4
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Wed Aug 28 14:37:50 2024 +0200
(chores) core/camel-util: use isEmpty as it is cleaner and faster
---
core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
a/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
b/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
index 280f79aa6a5..bd6288914e0 100644
--- a/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
+++ b/core/camel-util/src/main/java/org/apache/camel/util/StringHelper.java
@@ -555,8 +555,7 @@ public final class StringHelper {
* @return true if it contains dashes or false otherwise
*/
public static boolean isDashed(String text) {
- int length = text.length();
- return length != 0 && text.indexOf('-') != -1;
+ return !text.isEmpty() && text.indexOf('-') != -1;
}
/**