Skip to content

Commit 1f306c4

Browse files
replace local variable-if-with ternary operator in ContributionViewHolder
1 parent 0da2def commit 1f306c4

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

app/src/main/java/fr/free/nrw/commons/contributions/ContributionViewHolder.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,8 @@ public void init(int position, Contribution contribution) {
120120
*/
121121
@Nullable
122122
private String chooseImageSource(String thumbUrl, Uri localUri) {
123-
String imageSource = thumbUrl;
124-
if (TextUtils.isEmpty(imageSource)) {
125-
imageSource =
126-
localUri != null ? localUri.toString()
127-
: null;
128-
}
129-
return imageSource;
123+
return !TextUtils.isEmpty(thumbUrl) ? thumbUrl : (localUri != null ? localUri.toString()
124+
: null);
130125
}
131126

132127
/**

0 commit comments

Comments
 (0)