[Android] Util: avoid a copy

Jean-Baptiste Kempf git at videolan.org
Tue Oct 2 17:41:44 CEST 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Oct  2 17:33:33 2012 +0200| [d9b4eadc992756fde4cddfbe182fd9882075be81] | committer: Jean-Baptiste Kempf

Util: avoid a copy

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=d9b4eadc992756fde4cddfbe182fd9882075be81
---

 vlc-android/src/org/videolan/vlc/Util.java |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/Util.java b/vlc-android/src/org/videolan/vlc/Util.java
index 8eb227e..2588bdf 100644
--- a/vlc-android/src/org/videolan/vlc/Util.java
+++ b/vlc-android/src/org/videolan/vlc/Util.java
@@ -85,10 +85,9 @@ public class Util {
         return URI;
     }
 
-    public static String stripTrailingSlash(String _s) {
-        String s = _s;
+    public static String stripTrailingSlash(String s) {
         if( s.endsWith("/") && s.length() > 1 )
-            s = s.substring(0,s.length()-1);
+            return s.substring(0, s.length() - 1);
         return s;
     }
 



More information about the Android mailing list