diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-07-04 14:03:57 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-07-08 10:25:25 +0000 |
commit | 888e49802058f8093c8ff23f724e93e0c4769234 (patch) | |
tree | c3434014bb779367f72b136afd5236ccda864937 /src | |
parent | 8436fa30af3a74ca6bceefd88915f514ca9749d7 (diff) |
QHostInfo: perform deferred cleanup (std::any_of)
The code contained a copy of std::any_of from a time when we couldn't rely
it's availability in all compilers. We now can, so remove the copy.
Change-Id: I356077f58ae6a48b71f2dd98a2dab4e2acf985c7
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/network/kernel/qhostinfo.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 25ff873307..6302ad62eb 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -85,13 +85,6 @@ private: QString m_toBeLookedUp; }; -// ### C++11: remove once we can use std::any_of() -template<class InputIt, class UnaryPredicate> -bool any_of(InputIt first, InputIt last, UnaryPredicate p) -{ - return std::find_if(first, last, p) != last; -} - template <typename InputIt, typename OutputIt1, typename OutputIt2, typename UnaryPredicate> std::pair<OutputIt1, OutputIt2> separate_if(InputIt first, InputIt last, OutputIt1 dest1, OutputIt2 dest2, UnaryPredicate p) { @@ -950,7 +943,7 @@ void QHostInfoLookupManager::work() #if QT_CONFIG(thread) auto isAlreadyRunning = [this](QHostInfoRunnable *lookup) { - return any_of(currentLookups.cbegin(), currentLookups.cend(), ToBeLookedUpEquals(lookup->toBeLookedUp)); + return std::any_of(currentLookups.cbegin(), currentLookups.cend(), ToBeLookedUpEquals(lookup->toBeLookedUp)); }; // Transfer any postponed lookups that aren't currently running to the scheduled list, keeping already-running lookups: |