From 0b27fb80b10661c7078182227d265f3047ce4659 Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Wed, 16 Feb 2022 11:12:24 +0300 Subject: [PATCH] Fix for new coverity issues (#10378) * Fix for new coverity issues * Fixed cc coverity * Fixed code style * Revert some changes * Fixed build --- .../include/openvino/cc/selective_build.h | 8 ++++---- src/core/src/any.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/conditional_compilation/include/openvino/cc/selective_build.h b/src/common/conditional_compilation/include/openvino/cc/selective_build.h index 11bb8f7f7d4..061068174f3 100644 --- a/src/common/conditional_compilation/include/openvino/cc/selective_build.h +++ b/src/common/conditional_compilation/include/openvino/cc/selective_build.h @@ -92,16 +92,16 @@ case_wrapper make_case_wrapper(C && val) { } template class Fn, typename Ctx, typename T, typename Case> -bool match(Ctx && ctx, T && val, Case && cs) { +bool match(Ctx&& ctx, T&& val, Case && cs) { const bool is_matched = val == cs.value; if (is_matched) - Fn()(std::forward(ctx)); + Fn()(ctx); return is_matched; } template class Fn, typename Ctx, typename T, typename Case, typename ...Cases> -bool match(Ctx && ctx, T && val, Case && cs, Cases&&... cases) { - if (match(std::forward(ctx), std::forward(val), std::forward(cs))) +bool match(Ctx&& ctx, T&& val, Case && cs, Cases&&... cases) { + if (match(ctx, val, std::forward(cs))) return true; return match(std::forward(ctx), std::forward(val), std::forward(cases)...); } diff --git a/src/core/src/any.cpp b/src/core/src/any.cpp index 07cd26f5196..61f68b6150e 100644 --- a/src/core/src/any.cpp +++ b/src/core/src/any.cpp @@ -96,7 +96,7 @@ void Any::read(std::istream& istream) { } bool Any::operator==(const Any& other) const { - if (_impl == nullptr && other._impl == nullptr) { + if (_impl == nullptr || other._impl == nullptr) { return false; } if (_impl == other._impl) {