diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-26 22:25:22 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-06-26 23:05:21 +0200 |
commit | d65936200a2756e6619a109fa6fa673b91df802e (patch) | |
tree | 80b6b6fc7ba9023cbe47290b8ae1bc5468a19bb1 /options/connector.cpp | |
parent | 4046773c41ee3c0f65840828ab983cfd13451c85 (diff) |
modernize C++ syntax
No visible changes (hopefully).
Diffstat (limited to 'options/connector.cpp')
-rw-r--r-- | options/connector.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/options/connector.cpp b/options/connector.cpp index 6031d9ed..2d039ccf 100644 --- a/options/connector.cpp +++ b/options/connector.cpp @@ -27,7 +27,7 @@ bool connector::is_equal(const QString& name, const QVariant& val1, const QVaria auto it = connected_values.find(name); - if (it != connected_values.cend() && std::get<0>((*it).second).size() != 0) + if (it != connected_values.cend() && !std::get<0>((*it).second).empty()) return std::get<1>((*it).second)(val1, val2); else return generic_is_equal(val1, val2); @@ -37,29 +37,23 @@ bool connector::on_value_destructed_impl(const QString& name, value_type val) { QMutexLocker l(get_mtx()); - const bool ok = progn( - auto it = connected_values.find(name); + auto it = connected_values.find(name); - if (it != connected_values.end()) + if (it != connected_values.end()) + { + std::vector<value_type>& values = std::get<0>((*it).second); + for (auto it = values.begin(); it != values.end(); it++) { - std::vector<value_type>& values = std::get<0>((*it).second); - for (auto it = values.begin(); it != values.end(); it++) + if (*it == val) { - if (*it == val) - { - values.erase(it); - return true; - } + values.erase(it); + return true; } } - return false; - ); - - return ok; + } + return false; } - - void connector::on_value_destructed(const QString& name, value_type val) { if (!name.size()) |