changeset 49598:94ca39ef0b39

8199800: Optimize Boolean.parseBoolean(String) Reviewed-by: alanb Contributed-by: Sergey Tsypanov <sergei.tsypanov@yandex.ru>
author martin
date Mon, 02 Apr 2018 17:08:00 -0700
parents 8f041818aca9
children a7777856ae98
files src/java.base/share/classes/java/lang/Boolean.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
     }
 
     /**