Use enhanced 'for' loops

This commit is contained in:
TacoTheDank 2020-08-27 16:56:26 -04:00 committed by Stypox
parent a4feb3fc09
commit 6cb16be5df
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
2 changed files with 10 additions and 10 deletions

View File

@ -300,8 +300,8 @@ public abstract class FragmentStatePagerAdapterMenuWorkaround extends PagerAdapt
mSavedState.clear(); mSavedState.clear();
mFragments.clear(); mFragments.clear();
if (fss != null) { if (fss != null) {
for (int i = 0; i < fss.length; i++) { for (final Parcelable parcelable : fss) {
mSavedState.add((Fragment.SavedState) fss[i]); mSavedState.add((Fragment.SavedState) parcelable);
} }
} }
final Iterable<String> keys = bundle.keySet(); final Iterable<String> keys = bundle.keySet();

View File

@ -155,13 +155,13 @@ public class LargeTextMovementMethod extends LinkMovementMethod {
int bestStart = -1; int bestStart = -1;
int bestEnd = -1; int bestEnd = -1;
for (int i = 0; i < candidates.length; i++) { for (final ClickableSpan candidate : candidates) {
final int start = buffer.getSpanStart(candidates[i]); final int start = buffer.getSpanStart(candidate);
final int end = buffer.getSpanEnd(candidates[i]); final int end = buffer.getSpanEnd(candidate);
if ((end < selEnd || selStart == selEnd) && start >= visibleStart) { if ((end < selEnd || selStart == selEnd) && start >= visibleStart) {
if (end > bestEnd) { if (end > bestEnd) {
bestStart = buffer.getSpanStart(candidates[i]); bestStart = buffer.getSpanStart(candidate);
bestEnd = end; bestEnd = end;
} }
} }
@ -224,14 +224,14 @@ public class LargeTextMovementMethod extends LinkMovementMethod {
int bestStart = Integer.MAX_VALUE; int bestStart = Integer.MAX_VALUE;
int bestEnd = Integer.MAX_VALUE; int bestEnd = Integer.MAX_VALUE;
for (int i = 0; i < candidates.length; i++) { for (final ClickableSpan candidate : candidates) {
final int start = buffer.getSpanStart(candidates[i]); final int start = buffer.getSpanStart(candidate);
final int end = buffer.getSpanEnd(candidates[i]); final int end = buffer.getSpanEnd(candidate);
if ((start > selStart || selStart == selEnd) && end <= visibleEnd) { if ((start > selStart || selStart == selEnd) && end <= visibleEnd) {
if (start < bestStart) { if (start < bestStart) {
bestStart = start; bestStart = start;
bestEnd = buffer.getSpanEnd(candidates[i]); bestEnd = buffer.getSpanEnd(candidate);
} }
} }
} }