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:
parent
c8ce93290e
commit
0b27fb80b1
@ -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)...);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user