Formatting

This commit is contained in:
nathan 2017-03-10 17:02:54 +01:00
parent ef0cfe2f2e
commit 311fad500d

View File

@ -94,19 +94,14 @@ class Sys {
/** /**
* FROM: https://www.cqse.eu/en/blog/string-replace-performance/ * FROM: https://www.cqse.eu/en/blog/string-replace-performance/
* <p/> * <p/>
* Replaces all occurrences of keys of the given map in the given string * Replaces all occurrences of keys of the given map in the given string with the associated value in that map.
* with the associated value in that map.
* <p/> * <p/>
* This method is semantically the same as calling * This method is semantically the same as calling {@link String#replace(CharSequence, CharSequence)} for each of the
* {@link String#replace(CharSequence, CharSequence)} for each of the * entries in the map, but may be significantly faster for many replacements performed on a short string, since
* entries in the map, but may be significantly faster for many replacements * {@link String#replace(CharSequence, CharSequence)} uses regular expressions internally and results in many String
* performed on a short string, since * object allocations when applied iteratively.
* {@link String#replace(CharSequence, CharSequence)} uses regular
* expressions internally and results in many String object allocations when
* applied iteratively.
* <p/> * <p/>
* The order in which replacements are applied depends on the order of the * The order in which replacements are applied depends on the order of the map's entry set.
* map's entry set.
*/ */
public static public static
String replaceStringFast(String string, Map<String, String> replacements) { String replaceStringFast(String string, Map<String, String> replacements) {