mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-06 03:31: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.
|
* @return The analog channel is attached to an accumulator.
|
||||||
*/
|
*/
|
||||||
public boolean isAccumulatorChannel() {
|
public boolean isAccumulatorChannel() {
|
||||||
for (int i = 0; i < kAccumulatorChannels.length; i++) {
|
for (int channel : kAccumulatorChannels) {
|
||||||
if (m_channel == kAccumulatorChannels[i]) {
|
if (m_channel == channel) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,8 +324,8 @@ public class Scheduler implements NamedSendable {
|
|||||||
double[] toCancel = m_table.getNumberArray("Cancel", new double[0]);
|
double[] toCancel = m_table.getNumberArray("Cancel", new double[0]);
|
||||||
if (toCancel.length > 0) {
|
if (toCancel.length > 0) {
|
||||||
for (LinkedListElement e = m_firstCommand; e != null; e = e.getNext()) {
|
for (LinkedListElement e = m_firstCommand; e != null; e = e.getNext()) {
|
||||||
for (int i = 0; i < toCancel.length; i++) {
|
for (double d : toCancel) {
|
||||||
if (e.getData().hashCode() == toCancel[i]) {
|
if (e.getData().hashCode() == d) {
|
||||||
e.getData().cancel();
|
e.getData().cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,8 +75,8 @@ public class SortedVector<E> extends Vector<E> {
|
|||||||
Object[] array = new Object[size()];
|
Object[] array = new Object[size()];
|
||||||
copyInto(array);
|
copyInto(array);
|
||||||
removeAllElements();
|
removeAllElements();
|
||||||
for (int i = 0; i < array.length; i++) {
|
for (Object o : array) {
|
||||||
addElement((E) array[i]);
|
addElement((E) o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user