8199800: Optimize Boolean.parseBoolean(String)
authormartin
Mon, 02 Apr 2018 17:08:00 -0700
changeset 49509 94ca39ef0b39
parent 49508 8f041818aca9
child 49510 a7777856ae98
8199800: Optimize Boolean.parseBoolean(String) Reviewed-by: alanb Contributed-by: Sergey Tsypanov <sergei.tsypanov@yandex.ru>
src/java.base/share/classes/java/lang/Boolean.java
--- a/src/java.base/share/classes/java/lang/Boolean.java	Mon Apr 02 16:39:17 2018 -0700
+++ b/src/java.base/share/classes/java/lang/Boolean.java	Mon Apr 02 17:08:00 2018 -0700
@@ -129,7 +129,7 @@
      * @since 1.5
      */
     public static boolean parseBoolean(String s) {
-        return ((s != null) && s.equalsIgnoreCase("true"));
+        return "true".equalsIgnoreCase(s);
     }
 
     /**