mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpiutil] Improve wpi::circular_buffer iterators (#3410)
The implementation of wpi::circular_buffer has been effectively replaced with a dynamically sized copy of wpi::static_circular_buffer with a resize() member function.
This commit is contained in:
@@ -150,7 +150,9 @@ public class LinearFilter {
|
||||
double retVal = 0.0;
|
||||
|
||||
// Rotate the inputs
|
||||
m_inputs.addFirst(input);
|
||||
if (m_inputGains.length > 0) {
|
||||
m_inputs.addFirst(input);
|
||||
}
|
||||
|
||||
// Calculate the new value
|
||||
for (int i = 0; i < m_inputGains.length; i++) {
|
||||
@@ -161,7 +163,9 @@ public class LinearFilter {
|
||||
}
|
||||
|
||||
// Rotate the outputs
|
||||
m_outputs.addFirst(retVal);
|
||||
if (m_outputGains.length > 0) {
|
||||
m_outputs.addFirst(retVal);
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user