You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fs...@apache.org on 2020/02/09 11:03:58 UTC
[tomcat-jakartaee-migration] branch master updated: Use char
instead of single char string
This is an automated email from the ASF dual-hosted git repository.
fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat-jakartaee-migration.git
The following commit(s) were added to refs/heads/master by this push:
new d5e2d09 Use char instead of single char string
d5e2d09 is described below
commit d5e2d090c0b6152ef6d245817e390a46913b6d79
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Sun Feb 9 12:03:41 2020 +0100
Use char instead of single char string
The version of String#indexOf is faster for char.
---
src/main/java/org/apache/tomcat/jakartaee/Util.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/tomcat/jakartaee/Util.java b/src/main/java/org/apache/tomcat/jakartaee/Util.java
index 6834ad8..25f063f 100644
--- a/src/main/java/org/apache/tomcat/jakartaee/Util.java
+++ b/src/main/java/org/apache/tomcat/jakartaee/Util.java
@@ -27,7 +27,7 @@ public class Util {
public static String getExtension(String filename) {
// Extract the extension
- int lastPeriod = filename.lastIndexOf(".");
+ int lastPeriod = filename.lastIndexOf('.');
if (lastPeriod == -1) {
return null;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org