diff options
author | jfrijters <jfrijters> | 2012-08-29 11:25:42 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2012-08-29 11:25:42 +0400 |
commit | f70ca066b6a68c87b014039518e4d7a7459ee3da (patch) | |
tree | ae22886826fa7855660cbff431211bfce63e3a85 /openjdk | |
parent | 2f73fd3e14bf646c49a8e7f73beb20c72023c906 (diff) |
Optimized String.valueOf(char).
Diffstat (limited to 'openjdk')
-rw-r--r-- | openjdk/java/lang/StringHelper.java | 13 | ||||
-rw-r--r-- | openjdk/map.xml | 9 |
2 files changed, 7 insertions, 15 deletions
diff --git a/openjdk/java/lang/StringHelper.java b/openjdk/java/lang/StringHelper.java index 0309803d..61168d9f 100644 --- a/openjdk/java/lang/StringHelper.java +++ b/openjdk/java/lang/StringHelper.java @@ -2487,19 +2487,6 @@ final class StringHelper } /** - * Returns the string representation of the <code>char</code> - * argument. - * - * @param c a <code>char</code>. - * @return a string of length <code>1</code> containing - * as its single character the argument <code>c</code>. - */ - public static String valueOf(char c) { - char data[] = {c}; - return new String(0, 1, data); - } - - /** * Returns the string representation of the <code>int</code> argument. * <p> * The representation is exactly the one returned by the diff --git a/openjdk/map.xml b/openjdk/map.xml index e75ca5b6..077d983e 100644 --- a/openjdk/map.xml +++ b/openjdk/map.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" ?> <!-- - Copyright (C) 2002-2011 Jeroen Frijters + Copyright (C) 2002-2012 Jeroen Frijters This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -356,7 +356,12 @@ </method> <method name="valueOf" sig="(C)Ljava.lang.String;" modifiers="public static"> <parameter name="c" /> - <redirect class="java.lang.StringHelper" /> + <body> + <ldarg_0 /> + <ldc_i4_1 /> + <newobj type="System.String" name=".ctor" sig="(CI)V" /> + <ret /> + </body> </method> <method name="valueOf" sig="(F)Ljava.lang.String;" modifiers="public static"> <parameter name="f" /> |