Skip to content

Commit 19eddb7

Browse files
authored
Merge pull request #619 from f4ww4z/replace-clear
Replace 'removeAll(c)' with 'clear()'
2 parents f039ec3 + 547f2a0 commit 19eddb7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/src/main/java/fr/free/nrw/commons/Media.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public ArrayList<String> getCategories() {
173173
}
174174

175175
public void setCategories(List<String> categories) {
176-
this.categories.removeAll(this.categories);
176+
this.categories.clear();
177177
this.categories.addAll(categories);
178178
}
179179

app/src/main/java/fr/free/nrw/commons/media/MediaDetailFragment.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ protected void onPostExecute(Boolean success) {
235235
coordinates.setText(prettyCoordinates(media));
236236
uploadedDate.setText(prettyUploadedDate(media));
237237

238-
categoryNames.removeAll(categoryNames);
238+
categoryNames.clear();
239239
categoryNames.addAll(media.getCategories());
240240

241241
categoriesLoaded = true;
@@ -280,7 +280,7 @@ public void onLoadingComplete(String s, View view, Bitmap bitmap) {
280280
desc.setText(prettyDescription(media));
281281
license.setText(prettyLicense(media));
282282

283-
categoryNames.removeAll(categoryNames);
283+
categoryNames.clear();
284284
categoryNames.addAll(media.getCategories());
285285

286286
categoriesLoaded = true;

0 commit comments

Comments
 (0)