Replace for loops with foreach

This commit is contained in:
Eugene Cheung 2018-09-05 22:44:45 -04:00
commit 42bcb62d2c
No known key found for this signature in database
GPG key ID: E1FD745328866B0A
2 changed files with 5 additions and 5 deletions

View file

@ -165,9 +165,9 @@ public class MusicLibraryPagerAdapter extends FragmentPagerAdapter {
public static MusicFragments of(Class<?> cl) {
MusicFragments[] fragments = All.FRAGMENTS;
for (int i = 0; i < fragments.length; i++) {
if (cl.equals(fragments[i].mFragmentClass))
return fragments[i];
for (MusicFragments fragment : fragments) {
if (cl.equals(fragment.mFragmentClass))
return fragment;
}
throw new IllegalArgumentException("Unknown music fragment " + cl);

View file

@ -203,8 +203,8 @@ public abstract class CustomFragmentStatePagerAdapter extends android.support.v4
mSavedState.clear();
mFragments.clear();
if (fss != null) {
for (int i = 0; i < fss.length; i++) {
mSavedState.add((Fragment.SavedState) fss[i]);
for (Parcelable fs : fss) {
mSavedState.add((Fragment.SavedState) fs);
}
}
Iterable<String> keys = bundle.keySet();