Fix for new coverity issues (#10378)

* Fix for new coverity issues

* Fixed cc coverity

* Fixed code style

* Revert some changes

* Fixed build
This commit is contained in:
Ilya Churaev 2022-02-16 11:12:24 +03:00 committed by GitHub
parent c8ce93290e
commit 0b27fb80b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -95,13 +95,13 @@ template<template<typename...> class Fn, typename Ctx, typename T, typename Case
bool match(Ctx&& ctx, T&& val, Case && cs) {
const bool is_matched = val == cs.value;
if (is_matched)
Fn<typename Case::type>()(std::forward<Ctx>(ctx));
Fn<typename Case::type>()(ctx);
return is_matched;
}
template<template<typename...> class Fn, typename Ctx, typename T, typename Case, typename ...Cases>
bool match(Ctx&& ctx, T&& val, Case && cs, Cases&&... cases) {
if (match<Fn>(std::forward<Ctx>(ctx), std::forward<T>(val), std::forward<Case>(cs)))
if (match<Fn>(ctx, val, std::forward<Case>(cs)))
return true;
return match<Fn>(std::forward<Ctx>(ctx), std::forward<T>(val), std::forward<Cases>(cases)...);
}

View File

@ -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) {