mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 18:14:07 +08:00
Avoid subtraction of two uint
This commit is contained in:
parent
70d65ea55f
commit
8b6d665a13
@ -127,7 +127,7 @@ public:
|
||||
int index = (_head - i);
|
||||
index = index < 0 ? _size + index : index;
|
||||
|
||||
if (timestamp >= _buffer[index].time_us && timestamp - _buffer[index].time_us < (uint64_t)1e5) {
|
||||
if (timestamp >= _buffer[index].time_us && timestamp < _buffer[index].time_us + (uint64_t)1e5) {
|
||||
*sample = _buffer[index];
|
||||
|
||||
// Now we can set the tail to the item which
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user