From 63b40527eecbd50dfb2e33dba0eeca1271efbd48 Mon Sep 17 00:00:00 2001 From: rbock Date: Sun, 10 Sep 2017 15:12:45 +0200 Subject: [PATCH] Use clang-tidy to prevent else after return --- include/sqlpp11/data_types/text/result_field.h | 6 ++---- include/sqlpp11/rhs_wrap.h | 14 +++++--------- include/sqlpp11/serializer_context.h | 6 ++---- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/include/sqlpp11/data_types/text/result_field.h b/include/sqlpp11/data_types/text/result_field.h index b90dba42..6d82cf51 100644 --- a/include/sqlpp11/data_types/text/result_field.h +++ b/include/sqlpp11/data_types/text/result_field.h @@ -82,10 +82,8 @@ namespace sqlpp { return os << "NULL"; } - else - { - return os << e.value(); - } + + return os << e.value(); } } // namespace sqlpp #endif diff --git a/include/sqlpp11/rhs_wrap.h b/include/sqlpp11/rhs_wrap.h index 2fc140b1..4d8ccb91 100644 --- a/include/sqlpp11/rhs_wrap.h +++ b/include/sqlpp11/rhs_wrap.h @@ -71,17 +71,13 @@ namespace sqlpp { return t.is_null(); } - else + + if (t.is_null()) { - if (t.is_null()) - { - return false; - } - else - { - return t._is_trivial(); - } + return false; } + + return t._is_trivial(); } }; diff --git a/include/sqlpp11/serializer_context.h b/include/sqlpp11/serializer_context.h index 84eb60d8..3a79cad3 100644 --- a/include/sqlpp11/serializer_context.h +++ b/include/sqlpp11/serializer_context.h @@ -57,10 +57,8 @@ namespace sqlpp } return retVal; } - else - { - return arg; - } + + return arg; } std::ostream& _os;