Don't mix iterator and const_iterator

This avoids unnecessary detaches of the Qt container data.
The mismatches where detected by defining QT_STRICT_ITERATORS;
however, this define violates the ODR (causing linker errors),
and therefore is not added permanently.

Change-Id: Idd336a9c8b394214a820437ef1b92d2101f6101c
GPush-Base: 62b0848b9c
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Kai Koehne
2015-04-01 11:19:32 +02:00
parent 87e01423c9
commit 46fc33d914
23 changed files with 48 additions and 46 deletions

View File

@@ -705,8 +705,8 @@ void ClassOrNamespace::lookup_helper(const Name *name, ClassOrNamespace *binding
foreach (ClassOrNamespace *u, binding->usings()) foreach (ClassOrNamespace *u, binding->usings())
lookup_helper(name, u, result, processed, binding->_templateId); lookup_helper(name, u, result, processed, binding->_templateId);
Anonymouses::const_iterator cit = binding->_anonymouses.begin(); Anonymouses::const_iterator cit = binding->_anonymouses.constBegin();
Anonymouses::const_iterator citEnd = binding->_anonymouses.end(); Anonymouses::const_iterator citEnd = binding->_anonymouses.constEnd();
for (; cit != citEnd; ++cit) { for (; cit != citEnd; ++cit) {
const AnonymousNameId *anonymousNameId = cit.key(); const AnonymousNameId *anonymousNameId = cit.key();
ClassOrNamespace *a = cit.value(); ClassOrNamespace *a = cit.value();
@@ -802,8 +802,8 @@ ClassOrNamespace *ClassOrNamespace::lookupType(const Name *name, Block *block)
{ {
flush(); flush();
QHash<Block *, ClassOrNamespace *>::const_iterator citBlock = _blocks.find(block); QHash<Block *, ClassOrNamespace *>::const_iterator citBlock = _blocks.constFind(block);
if (citBlock != _blocks.end()) { if (citBlock != _blocks.constEnd()) {
ClassOrNamespace *nestedBlock = citBlock.value(); ClassOrNamespace *nestedBlock = citBlock.value();
QSet<ClassOrNamespace *> processed; QSet<ClassOrNamespace *> processed;
if (ClassOrNamespace *foundInNestedBlock if (ClassOrNamespace *foundInNestedBlock
@@ -815,7 +815,7 @@ ClassOrNamespace *ClassOrNamespace::lookupType(const Name *name, Block *block)
} }
} }
for (citBlock = _blocks.begin(); citBlock != _blocks.end(); ++citBlock) { for (citBlock = _blocks.constBegin(); citBlock != _blocks.constEnd(); ++citBlock) {
if (ClassOrNamespace *foundNestedBlock = citBlock.value()->lookupType(name, block)) if (ClassOrNamespace *foundNestedBlock = citBlock.value()->lookupType(name, block))
return foundNestedBlock; return foundNestedBlock;
} }
@@ -1027,8 +1027,8 @@ ClassOrNamespace *ClassOrNamespace::findOrCreateNestedAnonymousType(
const AnonymousNameId *anonymousNameId) const AnonymousNameId *anonymousNameId)
{ {
QHash<const AnonymousNameId *, ClassOrNamespace *>::const_iterator cit QHash<const AnonymousNameId *, ClassOrNamespace *>::const_iterator cit
= _anonymouses.find(anonymousNameId); = _anonymouses.constFind(anonymousNameId);
if (cit != _anonymouses.end()) { if (cit != _anonymouses.constEnd()) {
return cit.value(); return cit.value();
} else { } else {
ClassOrNamespace *newAnonymous = _factory->allocClassOrNamespace(this); ClassOrNamespace *newAnonymous = _factory->allocClassOrNamespace(this);
@@ -1083,8 +1083,8 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
} }
} else { } else {
QMap<const TemplateNameId *, ClassOrNamespace *>::const_iterator citInstantiation QMap<const TemplateNameId *, ClassOrNamespace *>::const_iterator citInstantiation
= reference->_instantiations.find(templId); = reference->_instantiations.constFind(templId);
if (citInstantiation != reference->_instantiations.end()) if (citInstantiation != reference->_instantiations.constEnd())
return citInstantiation.value(); return citInstantiation.value();
TemplateNameId *nonConstTemplId = const_cast<TemplateNameId *>(templId); TemplateNameId *nonConstTemplId = const_cast<TemplateNameId *>(templId);
// make this instantiation looks like specialization which help to find // make this instantiation looks like specialization which help to find

View File

@@ -1527,8 +1527,8 @@ void PluginManagerPrivate::profilingSummary() const
total += it1.value(); total += it1.value();
} }
Sorter::ConstIterator it2 = sorter.begin(); Sorter::ConstIterator it2 = sorter.constBegin();
Sorter::ConstIterator et2 = sorter.end(); Sorter::ConstIterator et2 = sorter.constEnd();
for (; it2 != et2; ++it2) for (; it2 != et2; ++it2)
qDebug("%-22s %8dms ( %5.2f%% )", qPrintable(it2.value()->name()), qDebug("%-22s %8dms ( %5.2f%% )", qPrintable(it2.value()->name()),
it2.key(), 100.0 * it2.key() / total); it2.key(), 100.0 * it2.key() / total);

View File

@@ -438,7 +438,7 @@ void SshConnectionPrivate::handleCurrentPacket()
} }
QHash<SshPacketType, HandlerInStates>::ConstIterator it QHash<SshPacketType, HandlerInStates>::ConstIterator it
= m_packetHandlers.find(m_incomingPacket.type()); = m_packetHandlers.constFind(m_incomingPacket.type());
if (it == m_packetHandlers.constEnd()) { if (it == m_packetHandlers.constEnd()) {
m_sendFacility.sendMsgUnimplementedPacket(m_incomingPacket.serverSeqNr()); m_sendFacility.sendMsgUnimplementedPacket(m_incomingPacket.serverSeqNr());
return; return;

View File

@@ -104,7 +104,7 @@ bool SshHostKeyDatabase::store(const QString &filePath, QString *error) const
SshHostKeyDatabase::KeyLookupResult SshHostKeyDatabase::matchHostKey(const QString &hostName, SshHostKeyDatabase::KeyLookupResult SshHostKeyDatabase::matchHostKey(const QString &hostName,
const QByteArray &key) const const QByteArray &key) const
{ {
auto it = d->hostKeys.find(hostName); auto it = d->hostKeys.constFind(hostName);
if (it == d->hostKeys.constEnd()) if (it == d->hostKeys.constEnd())
return KeyLookupNoMatch; return KeyLookupNoMatch;
if (it.value() == key) if (it.value() == key)

View File

@@ -681,7 +681,8 @@ static bool mergeGradleProperties(const QString &path, GradleProperties properti
} }
for (GradleProperties::const_iterator it = properties.begin(); it != properties.end(); ++it) for (GradleProperties::const_iterator it = properties.constBegin(); it != properties.constEnd();
++it)
file.write(it.key() + '=' + it.value() + '\n'); file.write(it.key() + '=' + it.value() + '\n');
file.close(); file.close();

View File

@@ -521,9 +521,9 @@ ParserTreeItem::ConstPtr Parser::getCachedOrParseDocumentTree(const CPlusPlus::D
const QString &fileName = doc->fileName(); const QString &fileName = doc->fileName();
d->docLocker.lockForRead(); d->docLocker.lockForRead();
ParserTreeItem::ConstPtr item = d->cachedDocTrees.value(fileName); ParserTreeItem::ConstPtr item = d->cachedDocTrees.value(fileName);
CitCachedDocTreeRevision citCachedDocTreeRevision = d->cachedDocTreesRevision.find(fileName); CitCachedDocTreeRevision citCachedDocTreeRevision = d->cachedDocTreesRevision.constFind(fileName);
if (!item.isNull() if (!item.isNull()
&& citCachedDocTreeRevision != d->cachedDocTreesRevision.end() && citCachedDocTreeRevision != d->cachedDocTreesRevision.constEnd()
&& citCachedDocTreeRevision.value() == doc->revision()) { && citCachedDocTreeRevision.value() == doc->revision()) {
d->docLocker.unlock(); d->docLocker.unlock();
return item; return item;
@@ -759,9 +759,9 @@ QStringList Parser::addProjectNode(const ParserTreeItem::Ptr &item, const Projec
// our own files // our own files
QStringList fileList; QStringList fileList;
CitCachedPrjFileLists cit = d->cachedPrjFileLists.find(nodePath); CitCachedPrjFileLists cit = d->cachedPrjFileLists.constFind(nodePath);
// try to improve parsing speed by internal cache // try to improve parsing speed by internal cache
if (cit != d->cachedPrjFileLists.end()) { if (cit != d->cachedPrjFileLists.constEnd()) {
fileList = cit.value(); fileList = cit.value();
} else { } else {
fileList = projectNodeFileList(node); fileList = projectNodeFileList(node);
@@ -800,9 +800,9 @@ QStringList Parser::getAllFiles(const ProjectNode *node)
const QString nodePath = node->path().toString(); const QString nodePath = node->path().toString();
CitCachedPrjFileLists cit = d->cachedPrjFileLists.find(nodePath); CitCachedPrjFileLists cit = d->cachedPrjFileLists.constFind(nodePath);
// try to improve parsing speed by internal cache // try to improve parsing speed by internal cache
if (cit != d->cachedPrjFileLists.end()) { if (cit != d->cachedPrjFileLists.constEnd()) {
fileList = cit.value(); fileList = cit.value();
} else { } else {
fileList = projectNodeFileList(node); fileList = projectNodeFileList(node);

View File

@@ -80,8 +80,8 @@ void ClearCaseSync::invalidateStatus(const QDir &viewRootDir,
void ClearCaseSync::invalidateStatusAllFiles() void ClearCaseSync::invalidateStatusAllFiles()
{ {
const StatusMap::ConstIterator send = m_statusMap->end(); const StatusMap::ConstIterator send = m_statusMap->constEnd();
for (StatusMap::ConstIterator it = m_statusMap->begin(); it != send; ++it) for (StatusMap::ConstIterator it = m_statusMap->constBegin(); it != send; ++it)
m_plugin->setStatus(it.key(), FileStatus::Unknown, false); m_plugin->setStatus(it.key(), FileStatus::Unknown, false);
} }

View File

@@ -249,8 +249,8 @@ bool CppSourceProcessor::checkFile(const QString &absoluteFilePath) const
QString CppSourceProcessor::resolveFile(const QString &fileName, IncludeType type) QString CppSourceProcessor::resolveFile(const QString &fileName, IncludeType type)
{ {
if (type == IncludeGlobal) { if (type == IncludeGlobal) {
QHash<QString, QString>::ConstIterator it = m_fileNameCache.find(fileName); QHash<QString, QString>::ConstIterator it = m_fileNameCache.constFind(fileName);
if (it != m_fileNameCache.end()) if (it != m_fileNameCache.constEnd())
return it.value(); return it.value();
const QString fn = resolveFile_helper(fileName, type); const QString fn = resolveFile_helper(fileName, type);
m_fileNameCache.insert(fileName, fn); m_fileNameCache.insert(fileName, fn);

View File

@@ -1850,8 +1850,8 @@ QString GdbEngine::cleanupFullName(const QString &fileName)
cleanFilePath.clear(); cleanFilePath.clear();
const QString base = FileName::fromString(fileName).fileName(); const QString base = FileName::fromString(fileName).fileName();
QMap<QString, QString>::const_iterator jt = m_baseNameToFullName.find(base); QMap<QString, QString>::const_iterator jt = m_baseNameToFullName.constFind(base);
while (jt != m_baseNameToFullName.end() && jt.key() == base) { while (jt != m_baseNameToFullName.constEnd() && jt.key() == base) {
// FIXME: Use some heuristics to find the "best" match. // FIXME: Use some heuristics to find the "best" match.
return jt.value(); return jt.value();
//++jt; //++jt;
@@ -4018,7 +4018,7 @@ bool GdbEngine::handleCliDisassemblerResult(const QByteArray &output, Disassembl
currentFunction = -1; currentFunction = -1;
DisassemblerLines result; DisassemblerLines result;
result.setBytesLength(dlines.bytesLength()); result.setBytesLength(dlines.bytesLength());
for (LineMap::const_iterator it = lineMap.begin(), et = lineMap.end(); it != et; ++it) { for (LineMap::const_iterator it = lineMap.constBegin(), et = lineMap.constEnd(); it != et; ++it) {
LineData d = *it; LineData d = *it;
if (d.function != currentFunction) { if (d.function != currentFunction) {
if (d.function != -1) { if (d.function != -1) {

View File

@@ -1510,8 +1510,8 @@ void QmlV8DebuggerClient::setCurrentFrameDetails(const QVariant &bodyVal, const
d->engine->gotoLocation(stackHandler->currentFrame()); d->engine->gotoLocation(stackHandler->currentFrame());
// Expand watch data that were previously expanded // Expand watch data that were previously expanded
QHash<quint64, QByteArray>::const_iterator itEnd = handlesToLookup.end(); QHash<quint64, QByteArray>::const_iterator itEnd = handlesToLookup.constEnd();
for (QHash<quint64, QByteArray>::const_iterator it = handlesToLookup.begin(); it != itEnd; ++it) for (QHash<quint64, QByteArray>::const_iterator it = handlesToLookup.constBegin(); it != itEnd; ++it)
expandObject(it.value(), it.key()); expandObject(it.value(), it.key());
emit stackFrameCompleted(); emit stackFrameCompleted();
} }

View File

@@ -317,7 +317,7 @@ Utils::Environment MsvcToolChain::readEnvironmentSetting(Utils::Environment& env
// Now loop through and process them // Now loop through and process them
QMap<QString,QString>::const_iterator envIter; QMap<QString,QString>::const_iterator envIter;
for (envIter = envPairs.begin(); envIter!=envPairs.end(); ++envIter) { for (envIter = envPairs.constBegin(); envIter!=envPairs.constEnd(); ++envIter) {
const QString expandedValue = winExpandDelayedEnvReferences(envIter.value(), env); const QString expandedValue = winExpandDelayedEnvReferences(envIter.value(), env);
if (!expandedValue.isEmpty()) if (!expandedValue.isEmpty())
result.set(envIter.key(), expandedValue); result.set(envIter.key(), expandedValue);

View File

@@ -692,7 +692,7 @@ void SessionManager::setValue(const QString &name, const QVariant &value)
QVariant SessionManager::value(const QString &name) QVariant SessionManager::value(const QString &name)
{ {
QMap<QString, QVariant>::const_iterator it = d->m_values.find(name); QMap<QString, QVariant>::const_iterator it = d->m_values.constFind(name);
return (it == d->m_values.constEnd()) ? QVariant() : *it; return (it == d->m_values.constEnd()) ? QVariant() : *it;
} }

View File

@@ -127,7 +127,7 @@ Utils::Environment WinCEToolChain::readEnvironmentSetting(Utils::Environment &en
return result; return result;
QMap<QString,QString>::const_iterator envPairIter; QMap<QString,QString>::const_iterator envPairIter;
for (envPairIter = envPairs.begin(); envPairIter!=envPairs.end(); ++envPairIter) { for (envPairIter = envPairs.constBegin(); envPairIter!=envPairs.constEnd(); ++envPairIter) {
// Replace the env values with those from the WinCE SDK // Replace the env values with those from the WinCE SDK
QString varValue = envPairIter.value(); QString varValue = envPairIter.value();
if (envPairIter.key() == QLatin1String("PATH")) if (envPairIter.key() == QLatin1String("PATH"))

View File

@@ -154,7 +154,7 @@ void QmlProfilerEventsModelProxy::notesChanged(int typeIndex)
} }
} else { } else {
d->notes.remove(typeIndex); d->notes.remove(typeIndex);
QVariantList changedNotes = notesModel->byTypeId(typeIndex); const QVariantList changedNotes = notesModel->byTypeId(typeIndex);
if (!changedNotes.isEmpty()) { if (!changedNotes.isEmpty()) {
QStringList newNotes; QStringList newNotes;
for (QVariantList::ConstIterator it = changedNotes.begin(); it != changedNotes.end(); for (QVariantList::ConstIterator it = changedNotes.begin(); it != changedNotes.end();

View File

@@ -495,7 +495,7 @@ bool QtVersionManager::isValidId(int id)
BaseQtVersion *QtVersionManager::version(int id) BaseQtVersion *QtVersionManager::version(int id)
{ {
QTC_ASSERT(isLoaded(), return 0); QTC_ASSERT(isLoaded(), return 0);
QMap<int, BaseQtVersion *>::const_iterator it = m_versions.find(id); QMap<int, BaseQtVersion *>::const_iterator it = m_versions.constFind(id);
if (it == m_versions.constEnd()) if (it == m_versions.constEnd())
return 0; return 0;
return it.value(); return it.value();

View File

@@ -230,7 +230,7 @@ QVariantMap AbstractRemoteLinuxDeployService::exportDeployTimes() const
QVariantList remotePathList; QVariantList remotePathList;
QVariantList timeList; QVariantList timeList;
typedef QHash<DeployParameters, QDateTime>::ConstIterator DepIt; typedef QHash<DeployParameters, QDateTime>::ConstIterator DepIt;
for (DepIt it = d->lastDeployed.begin(); it != d->lastDeployed.end(); ++it) { for (DepIt it = d->lastDeployed.constBegin(); it != d->lastDeployed.constEnd(); ++it) {
fileList << it.key().file.localFilePath().toString(); fileList << it.key().file.localFilePath().toString();
remotePathList << it.key().file.remoteDirectory(); remotePathList << it.key().file.remoteDirectory();
hostList << it.key().host; hostList << it.key().host;

View File

@@ -207,7 +207,7 @@ int SnippetsCollection::totalActiveSnippets(const QString &groupId) const
{ {
const int group = groupIndex(groupId); const int group = groupIndex(groupId);
return std::distance<QList<Snippet>::const_iterator>(m_snippets.at(group).begin(), return std::distance<QList<Snippet>::const_iterator>(m_snippets.at(group).begin(),
m_activeSnippetsEnd.at(group)); QList<Snippet>::const_iterator(m_activeSnippetsEnd.at(group)));
} }
int SnippetsCollection::totalSnippets(const QString &groupId) const int SnippetsCollection::totalSnippets(const QString &groupId) const

View File

@@ -3271,7 +3271,7 @@ void TextEditorWidgetPrivate::insertIntoBlockSelection(const QString &text)
const QStringList::const_iterator endLine = textLines.constEnd(); const QStringList::const_iterator endLine = textLines.constEnd();
for (QStringList::const_iterator textLine = textLines.constBegin(); textLine != endLine; ++textLine) for (QStringList::const_iterator textLine = textLines.constBegin(); textLine != endLine; ++textLine)
textLength += qMax(0, ts.columnCountForText(*textLine, column) - textLength); textLength += qMax(0, ts.columnCountForText(*textLine, column) - textLength);
for (QStringList::iterator textLine = textLines.begin(); textLine != endLine; ++textLine) for (QStringList::iterator textLine = textLines.begin(); textLine != textLines.end(); ++textLine)
textLine->append(QString(qMax(0, textLength - ts.columnCountForText(*textLine, column)), QLatin1Char(' '))); textLine->append(QString(qMax(0, textLength - ts.columnCountForText(*textLine, column)), QLatin1Char(' ')));
// insert Text // insert Text

View File

@@ -499,8 +499,9 @@ void TextEditorOverlay::mapEquivalentSelections()
const QList<QString> &uniqueKeys = all.uniqueKeys(); const QList<QString> &uniqueKeys = all.uniqueKeys();
foreach (const QString &key, uniqueKeys) { foreach (const QString &key, uniqueKeys) {
QList<int> indexes; QList<int> indexes;
QMap<QString, int>::const_iterator lbit = all.lowerBound(key); const auto cAll = all;
QMap<QString, int>::const_iterator ubit = all.upperBound(key); QMap<QString, int>::const_iterator lbit = cAll.lowerBound(key);
QMap<QString, int>::const_iterator ubit = cAll.upperBound(key);
while (lbit != ubit) { while (lbit != ubit) {
indexes.append(lbit.value()); indexes.append(lbit.value());
++lbit; ++lbit;

View File

@@ -434,7 +434,7 @@ void ValgrindGlobalSettings::writeSettings() const
settings->beginGroup(QLatin1String(groupC)); settings->beginGroup(QLatin1String(groupC));
QVariantMap map; QVariantMap map;
toMap(map); toMap(map);
for (QVariantMap::ConstIterator it = map.begin(); it != map.end(); ++it) for (QVariantMap::ConstIterator it = map.constBegin(); it != map.constEnd(); ++it)
settings->setValue(it.key(), it.value()); settings->setValue(it.key(), it.value());
settings->endGroup(); settings->endGroup();
} }

View File

@@ -294,7 +294,7 @@ void Parser::Private::checkProtocolVersion(const QString &versionStr)
void Parser::Private::checkTool(const QString &reportedStr) void Parser::Private::checkTool(const QString &reportedStr)
{ {
const QHash<QString,Parser::Tool>::ConstIterator reported = toolsByName.find(reportedStr); const QHash<QString,Parser::Tool>::ConstIterator reported = toolsByName.constFind(reportedStr);
if (reported == toolsByName.constEnd()) if (reported == toolsByName.constEnd())
throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser", throw ParserException(QCoreApplication::translate("Valgrind::XmlProtocol::Parser",
@@ -353,7 +353,7 @@ XauxWhat Parser::Private::parseXauxWhat()
MemcheckErrorKind Parser::Private::parseMemcheckErrorKind(const QString &kind) MemcheckErrorKind Parser::Private::parseMemcheckErrorKind(const QString &kind)
{ {
const QHash<QString,MemcheckErrorKind>::ConstIterator it = errorKindsByName_memcheck.find(kind); const QHash<QString,MemcheckErrorKind>::ConstIterator it = errorKindsByName_memcheck.constFind(kind);
if (it != errorKindsByName_memcheck.constEnd()) if (it != errorKindsByName_memcheck.constEnd())
return *it; return *it;
else else
@@ -363,7 +363,7 @@ MemcheckErrorKind Parser::Private::parseMemcheckErrorKind(const QString &kind)
HelgrindErrorKind Parser::Private::parseHelgrindErrorKind(const QString &kind) HelgrindErrorKind Parser::Private::parseHelgrindErrorKind(const QString &kind)
{ {
const QHash<QString,HelgrindErrorKind>::ConstIterator it = errorKindsByName_helgrind.find(kind); const QHash<QString,HelgrindErrorKind>::ConstIterator it = errorKindsByName_helgrind.constFind(kind);
if (it != errorKindsByName_helgrind.constEnd()) if (it != errorKindsByName_helgrind.constEnd())
return *it; return *it;
else else
@@ -373,7 +373,7 @@ HelgrindErrorKind Parser::Private::parseHelgrindErrorKind(const QString &kind)
PtrcheckErrorKind Parser::Private::parsePtrcheckErrorKind(const QString &kind) PtrcheckErrorKind Parser::Private::parsePtrcheckErrorKind(const QString &kind)
{ {
const QHash<QString,PtrcheckErrorKind>::ConstIterator it = errorKindsByName_ptrcheck.find(kind); const QHash<QString,PtrcheckErrorKind>::ConstIterator it = errorKindsByName_ptrcheck.constFind(kind);
if (it != errorKindsByName_ptrcheck.constEnd()) if (it != errorKindsByName_ptrcheck.constEnd())
return *it; return *it;
else else

View File

@@ -139,7 +139,7 @@ QStringList FindKeyOperation::findKey(const QVariant &in, const QString &key, co
{ {
QStringList result; QStringList result;
if (in.type() == QVariant::Map) { if (in.type() == QVariant::Map) {
QVariantMap map = in.toMap(); const QVariantMap map = in.toMap();
for (QVariantMap::const_iterator i = map.begin(); i != map.end(); ++i) { for (QVariantMap::const_iterator i = map.begin(); i != map.end(); ++i) {
QString pfx = prefix; QString pfx = prefix;
if (!pfx.isEmpty()) if (!pfx.isEmpty())

View File

@@ -152,7 +152,7 @@ QStringList FindValueOperation::findValue(const QVariant &in, const QVariant &va
if (in.type() == value.type() && in == value) { if (in.type() == value.type() && in == value) {
result << prefix; result << prefix;
} else if (in.type() == QVariant::Map) { } else if (in.type() == QVariant::Map) {
QVariantMap map = in.toMap(); const QVariantMap map = in.toMap();
for (QVariantMap::const_iterator i = map.begin(); i != map.end(); ++i) { for (QVariantMap::const_iterator i = map.begin(); i != map.end(); ++i) {
QString pfx = prefix; QString pfx = prefix;
if (!pfx.isEmpty()) if (!pfx.isEmpty())