Browse Source

Merge pull request #2548 from nextcloud/lastindexof_performance

datamodel: String function use should be optimized for single characters
Andy Scherzinger 7 years ago
parent
commit
4ce3900025

+ 2 - 2
src/main/java/com/owncloud/android/datamodel/SyncedFolderProvider.java

@@ -237,9 +237,9 @@ public class SyncedFolderProvider extends Observable {
             if (!new File(syncedFolder.getLocalPath()).exists()) {
                 String localPath = syncedFolder.getLocalPath();
                 if (localPath.endsWith("/")) {
-                    localPath = localPath.substring(0, localPath.lastIndexOf("/"));
+                    localPath = localPath.substring(0, localPath.lastIndexOf('/'));
                 }
-                localPath = localPath.substring(0, localPath.lastIndexOf("/"));
+                localPath = localPath.substring(0, localPath.lastIndexOf('/'));
                 if (new File(localPath).exists()) {
                     syncedFolders.get(i).setLocalPath(localPath);
                     updateSyncFolder(syncedFolder);