Skip to content
Snippets Groups Projects
Commit 1ca181db authored by Adrien Béraud's avatar Adrien Béraud
Browse files

value: simplify expression

parent 1f3bf697
No related branches found
No related tags found
No related merge requests found
...@@ -497,8 +497,7 @@ template <typename T> ...@@ -497,8 +497,7 @@ template <typename T>
bool subset(std::vector<T> fds, std::vector<T> qfds) bool subset(std::vector<T> fds, std::vector<T> qfds)
{ {
for (auto& fd : fds) { for (auto& fd : fds) {
auto correspondance = std::find_if(qfds.begin(), qfds.end(), [&fd](T& _vfd) { return fd == _vfd; }); if (std::find_if(qfds.begin(), qfds.end(), [&fd](T& _vfd) { return fd == _vfd; }) == qfds.end())
if (correspondance == qfds.end())
return false; return false;
} }
return true; return true;
...@@ -506,10 +505,9 @@ bool subset(std::vector<T> fds, std::vector<T> qfds) ...@@ -506,10 +505,9 @@ bool subset(std::vector<T> fds, std::vector<T> qfds)
bool Select::isSatisfiedBy(const Select& os) const { bool Select::isSatisfiedBy(const Select& os) const {
/* empty, means all values are selected. */ /* empty, means all values are selected. */
if (fieldSelection_.empty() and not os.fieldSelection_.empty()) return fieldSelection_.empty() ?
return false; os.fieldSelection_.empty() :
else subset(fieldSelection_, os.fieldSelection_);
return subset(fieldSelection_, os.fieldSelection_);
} }
bool Where::isSatisfiedBy(const Where& ow) const { bool Where::isSatisfiedBy(const Where& ow) const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment