Skip to content
Snippets Groups Projects
Commit 7115402e authored by PierreGtch's avatar PierreGtch
Browse files

Small fix

parent 10640b9e
No related branches found
No related tags found
1 merge request!290Resolve "ProcessorLoopClosureBase class"
...@@ -345,13 +345,13 @@ T Buffer<T>::select(const TimeStamp& _time_stamp, const Scalar& _time_tolerance) ...@@ -345,13 +345,13 @@ T Buffer<T>::select(const TimeStamp& _time_stamp, const Scalar& _time_tolerance)
bool prev_exists = (post != container_.begin()); bool prev_exists = (post != container_.begin());
bool post_exists = (post != container_.end()); bool post_exists = (post != container_.end());
bool post_ok = post_exists && checkTimeTolerance(post->first, _time_stamp, _time_tolerance); bool post_ok = post_exists && simpleCheckTimeTolerance(post->first, _time_stamp, _time_tolerance);
if (prev_exists) if (prev_exists)
{ {
Buffer<T>::Iterator prev = std::prev(post); Buffer<T>::Iterator prev = std::prev(post);
bool prev_ok = checkTimeTolerance(prev->first, _time_stamp, _time_tolerance); bool prev_ok = simpleCheckTimeTolerance(prev->first, _time_stamp, _time_tolerance);
if (prev_ok && !post_ok) if (prev_ok && !post_ok)
return prev->second; return prev->second;
...@@ -386,7 +386,7 @@ T Buffer<T>::selectFirstBefore(const TimeStamp& _time_stamp, const Scalar& _time ...@@ -386,7 +386,7 @@ T Buffer<T>::selectFirstBefore(const TimeStamp& _time_stamp, const Scalar& _time
return container_.begin()->second; return container_.begin()->second;
// Return first pack if despite being newer, it is within the time tolerance // Return first pack if despite being newer, it is within the time tolerance
if (checkTimeTolerance(container_.begin()->first, _time_stamp, _time_tolerance)) if (simpleCheckTimeTolerance(container_.begin()->first, _time_stamp, _time_tolerance))
return container_.begin()->second; return container_.begin()->second;
// otherwise return nullptr (no pack before the provided ts or within the tolerance was found) // otherwise return nullptr (no pack before the provided ts or within the tolerance was found)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment