1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 08:30:44 +00:00

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();
mFragments.clear();
if (fss != null) {
for (int i = 0; i < fss.length; i++) {
mSavedState.add((Fragment.SavedState) fss[i]);
for (final Parcelable parcelable : fss) {
mSavedState.add((Fragment.SavedState) parcelable);
}
}
final Iterable<String> keys = bundle.keySet();

View File

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