[Android] Increase StringBuilder capacity to avoid expanding
Geoffrey Métais
git at videolan.org
Fri Feb 24 16:32:04 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 24 16:25:03 2017 +0100| [358389405c691c47cbdb02f9773449207e1dd105] | committer: Geoffrey Métais
Increase StringBuilder capacity to avoid expanding
> https://code.videolan.org/videolan/vlc-android/commit/358389405c691c47cbdb02f9773449207e1dd105
---
libvlc/src/org/videolan/libvlc/util/VLCUtil.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/libvlc/src/org/videolan/libvlc/util/VLCUtil.java b/libvlc/src/org/videolan/libvlc/util/VLCUtil.java
index 2ce0f1d..441bc2e 100644
--- a/libvlc/src/org/videolan/libvlc/util/VLCUtil.java
+++ b/libvlc/src/org/videolan/libvlc/util/VLCUtil.java
@@ -525,8 +525,7 @@ public class VLCUtil {
*/
public static Uri UriFromMrl(String mrl) {
final char array[] = mrl.toCharArray();
- final StringBuilder sb = new StringBuilder(array.length);
-
+ final StringBuilder sb = new StringBuilder(array.length*2);
for (int i = 0; i < array.length; ++i) {
final char c = array[i];
if (c == '%') {
@@ -541,7 +540,6 @@ public class VLCUtil {
} catch (NumberFormatException ignored) {
}
}
-
}
sb.append(c);
}
More information about the Android
mailing list