From 57ea09808e0d81659f1f9458171ca5b81a05b872 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Sun, 10 Mar 2019 16:38:00 -0400
Subject: [PATCH] value: fix chain null check

---
 include/opendht/value.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/opendht/value.h b/include/opendht/value.h
index 34224ff7..e4fea2a3 100644
--- a/include/opendht/value.h
+++ b/include/opendht/value.h
@@ -165,8 +165,8 @@ struct OPENDHT_PUBLIC Value
             return chainOr(std::move(f1), std::move(f2));
         }
         static Filter chain(Filter&& f1, Filter&& f2) {
-            if (not f1) return std::move(f1);
-            if (not f2) return std::move(f2);
+            if (not f1) return std::move(f2);
+            if (not f2) return std::move(f1);
             return [f1,f2](const Value& v) {
                 return f1(v) and f2(v);
             };
@@ -874,7 +874,7 @@ struct OPENDHT_PUBLIC Query
 {
     static const std::string QUERY_PARSE_ERROR;
 
-    Query(Select s = {}, Where w = {}, bool none = false) : select(s), where(w), none(none) { };
+    Query(Select s = {}, Where w = {}, bool none = false) : select(std::move(s)), where(std::move(w)), none(none) { };
 
     /**
      * Initializes a query based on a SQL-ish formatted string. The abstract
-- 
GitLab