mirror of
https://github.com/nextcloud/android.git
synced 2024-11-24 06:05:42 +03:00
operations: Replace use of Vector with a unsynchronized equivalent.
Early classes of the Java API, such as Vector, Hashtable and StringBuffer, were synchronized to make them thread-safe. Unfortunately, synchronization has a big negative impact on performance, even when using these collections from a single thread. It is better to use their new unsynchronized replacements. ArrayList is pretty much a drop-in replacement for Vectors and I cant see any reason to use Vector unless there is some sort of special requirement for it. ArrayList will generally give you better performance and only half the data growth when items are added to the list.
This commit is contained in:
parent
d54b666d02
commit
62c4836fc1
1 changed files with 1 additions and 1 deletions
|
@ -360,7 +360,7 @@ public class RefreshFolderOperation extends RemoteOperation {
|
|||
|
||||
Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath() + " changed - starting update of local data ");
|
||||
|
||||
List<OCFile> updatedFiles = new Vector<>(folderAndFiles.size() - 1);
|
||||
List<OCFile> updatedFiles = new ArrayList<>(folderAndFiles.size() - 1);
|
||||
mFilesToSyncContents.clear();
|
||||
|
||||
// if local folder is encrypted, download fresh metadata
|
||||
|
|
Loading…
Reference in a new issue