summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/corelib/tools/qflatmap_p.h42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/corelib/tools/qflatmap_p.h b/src/corelib/tools/qflatmap_p.h
index 5c2aadb4d3f..7e8b230fee6 100644
--- a/src/corelib/tools/qflatmap_p.h
+++ b/src/corelib/tools/qflatmap_p.h
@@ -610,17 +610,6 @@ public:
return do_remove(binary_find(key));
}
-private:
- bool do_remove(iterator it)
- {
- if (it != end()) {
- erase(it);
- return true;
- }
- return false;
- }
-public:
-
iterator erase(iterator it)
{
c.values.erase(toValuesIterator(it));
@@ -632,18 +621,6 @@ public:
return do_take(binary_find(key));
}
-private:
- T do_take(iterator it)
- {
- if (it != end()) {
- T result = std::move(it.value());
- erase(it);
- return result;
- }
- return {};
- }
-public:
-
bool contains(const Key &key) const
{
return binary_find(key) != end();
@@ -832,6 +809,25 @@ public:
}
private:
+ bool do_remove(iterator it)
+ {
+ if (it != end()) {
+ erase(it);
+ return true;
+ }
+ return false;
+ }
+
+ T do_take(iterator it)
+ {
+ if (it != end()) {
+ T result = std::move(it.value());
+ erase(it);
+ return result;
+ }
+ return {};
+ }
+
template <class InputIt, is_compatible_iterator<InputIt> = nullptr>
void initWithRange(InputIt first, InputIt last)
{