From 8b6d665a1331f94091caf2f262e09d508eb8975c Mon Sep 17 00:00:00 2001 From: kamilritz Date: Sun, 26 Apr 2020 17:54:38 +0200 Subject: [PATCH] Avoid subtraction of two uint --- EKF/RingBuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EKF/RingBuffer.h b/EKF/RingBuffer.h index 8f2f7312f2..f9f60d1598 100644 --- a/EKF/RingBuffer.h +++ b/EKF/RingBuffer.h @@ -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