From 379b7dffc678bda76026b9b0328e8b0dd033f731 Mon Sep 17 00:00:00 2001
From: Joan Sola <jsola@iri.upc.edu>
Date: Mon, 19 Feb 2018 19:31:21 +0100
Subject: [PATCH] Fix again decision logic

---
 src/processor_base.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/processor_base.cpp b/src/processor_base.cpp
index 847a438d3..a5c44e2ab 100644
--- a/src/processor_base.cpp
+++ b/src/processor_base.cpp
@@ -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;
-- 
GitLab