Commit 31e2fcc8 authored by Ulf Hermann's avatar Ulf Hermann

QmlProfiler: Avoid QHash::equal_range()

It was only introduced in Qt 5.7.

Change-Id: I5f810c7244b8e8551c3249d8a8f7c6625185692e
Reviewed-by: Christian Kandeler's avatarChristian Kandeler <christian.kandeler@qt.io>
parent 2b159ac9
......@@ -172,17 +172,18 @@ void QmlProfilerDetailsRewriter::clearRequests()
void QmlProfilerDetailsRewriter::documentReady(QmlJS::Document::Ptr doc)
{
auto range = m_pendingEvents.equal_range(doc->fileName());
const QString &fileName = doc->fileName();
auto first = m_pendingEvents.find(fileName);
// this could be triggered by an unrelated reload in Creator
if (range.first == range.second)
if (first == m_pendingEvents.end())
return;
// if the file could not be opened this slot is still triggered
// but source will be an empty string
QString source = doc->source();
const bool sourceHasContents = !source.isEmpty();
for (auto it = range.first; it != range.second;) {
for (auto it = first; it != m_pendingEvents.end() && it.key() == fileName;) {
if (sourceHasContents)
rewriteDetailsForLocation(source, doc, it->requestId, it->location);
it = m_pendingEvents.erase(it);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment