mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Convert for loops to foreach loops (#592)
This commit is contained in:
committed by
Peter Johnson
parent
848280d1f1
commit
c45fb73f36
@@ -305,8 +305,8 @@ public class AnalogInput extends SensorBase implements PIDSource, LiveWindowSend
|
||||
* @return The analog channel is attached to an accumulator.
|
||||
*/
|
||||
public boolean isAccumulatorChannel() {
|
||||
for (int i = 0; i < kAccumulatorChannels.length; i++) {
|
||||
if (m_channel == kAccumulatorChannels[i]) {
|
||||
for (int channel : kAccumulatorChannels) {
|
||||
if (m_channel == channel) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,8 +324,8 @@ public class Scheduler implements NamedSendable {
|
||||
double[] toCancel = m_table.getNumberArray("Cancel", new double[0]);
|
||||
if (toCancel.length > 0) {
|
||||
for (LinkedListElement e = m_firstCommand; e != null; e = e.getNext()) {
|
||||
for (int i = 0; i < toCancel.length; i++) {
|
||||
if (e.getData().hashCode() == toCancel[i]) {
|
||||
for (double d : toCancel) {
|
||||
if (e.getData().hashCode() == d) {
|
||||
e.getData().cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,8 +75,8 @@ public class SortedVector<E> extends Vector<E> {
|
||||
Object[] array = new Object[size()];
|
||||
copyInto(array);
|
||||
removeAllElements();
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
addElement((E) array[i]);
|
||||
for (Object o : array) {
|
||||
addElement((E) o);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user