Nicer loops. Don't start an iterator if not needed
This commit is contained in:
parent
26e7875c02
commit
0efdc9df00
@ -443,8 +443,9 @@ public class AppDetails extends ListActivity {
|
||||
tv = (TextView) infoView.findViewById(R.id.permissions_list);
|
||||
if (pref_permissions) {
|
||||
CommaSeparatedList permsList = app.apks.get(0).detail_permissions;
|
||||
Iterator<String> permissions = permsList != null ? permsList.iterator() : null;
|
||||
if (null != permissions && permissions.hasNext()) {
|
||||
if (permsList == null) tv.setText("NONE");
|
||||
else {
|
||||
Iterator<String> permissions = permsList.iterator();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (permissions.hasNext()) {
|
||||
String permissionName = permissions.next();
|
||||
@ -460,8 +461,6 @@ public class AppDetails extends ListActivity {
|
||||
}
|
||||
}
|
||||
tv.setText(sb.toString());
|
||||
} else {
|
||||
tv.setText("NONE");
|
||||
}
|
||||
tv = (TextView) infoView.findViewById(R.id.permissions);
|
||||
tv.setText(getResources().getString(
|
||||
|
Loading…
x
Reference in New Issue
Block a user