Skip to content
Snippets Groups Projects
Commit 379b7dff authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Fix again decision logic

parent 5779e3cb
No related branches found
No related tags found
1 merge request!157Kfpackmanager
......@@ -101,16 +101,16 @@ KFPackPtr KFPackBuffer::selectPack(const TimeStamp& _time_stamp, const Scalar& _
{
prev = std::prev(post);
if (!checkTimeTolerance(prev->first, prev->second->time_tolerance, _time_stamp, _time_tolerance)
&& check_post
&& checkTimeTolerance(post->first, post->second->time_tolerance, _time_stamp, _time_tolerance))
&& (check_post
&& checkTimeTolerance(post->first, post->second->time_tolerance, _time_stamp, _time_tolerance)))
return post->second;
else if (checkTimeTolerance(prev->first, prev->second->time_tolerance, _time_stamp, _time_tolerance)
&& check_post
&& !checkTimeTolerance(post->first, post->second->time_tolerance, _time_stamp, _time_tolerance))
&& !(check_post
&& checkTimeTolerance(post->first, post->second->time_tolerance, _time_stamp, _time_tolerance)))
return prev->second;
else if (checkTimeTolerance(prev->first, prev->second->time_tolerance, _time_stamp, _time_tolerance)
&& check_post
&& checkTimeTolerance(post->first, post->second->time_tolerance, _time_stamp, _time_tolerance))
&& (check_post
&& checkTimeTolerance(post->first, post->second->time_tolerance, _time_stamp, _time_tolerance)))
{
if (std::fabs((*post).first - _time_stamp) < std::fabs((*prev).first - _time_stamp))
return post->second;
......
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