diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-31 08:44:22 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-31 07:14:02 +0000 |
commit | 056e58b48b3b8858c4d4ac0d1c593b5f7fb46d0c (patch) | |
tree | 888b15683083b7142445667e5c335f4adb98d52b /sources/shiboken2 | |
parent | 83a3459eaa30669b50d07c0341eee48c43197424 (diff) |
shiboken: Simplify TypeDatabase::findTypes()
Use QMultiMap::equal_range().
Amends a6d12454983f8b1f2f8e7087de4b11ccd9126178
Task-number: PYSIDE-757
Change-Id: I82018ca78226f8fe45cd1ab43d8c05a0b0fc8811
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2')
-rw-r--r-- | sources/shiboken2/ApiExtractor/typedatabase.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sources/shiboken2/ApiExtractor/typedatabase.cpp b/sources/shiboken2/ApiExtractor/typedatabase.cpp index 88d7d6956..c418cfe3f 100644 --- a/sources/shiboken2/ApiExtractor/typedatabase.cpp +++ b/sources/shiboken2/ApiExtractor/typedatabase.cpp @@ -204,11 +204,8 @@ TypeEntry* TypeDatabase::findType(const QString& name) const TypeEntryMultiMapConstIteratorRange TypeDatabase::findTypes(const QString &name) const { - const auto lower = m_entries.lowerBound(name); - const auto end = m_entries.constEnd(); - return lower != end && lower.key() == name - ? TypeEntryMultiMapConstIteratorRange{lower, m_entries.upperBound(name)} - : TypeEntryMultiMapConstIteratorRange{end, end}; + const auto range = m_entries.equal_range(name); + return {range.first, range.second}; } PrimitiveTypeEntryList TypeDatabase::primitiveTypes() const |