summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qxmlstream.g
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/serialization/qxmlstream.g')
-rw-r--r--src/corelib/serialization/qxmlstream.g12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/serialization/qxmlstream.g b/src/corelib/serialization/qxmlstream.g
index b623de9505..e630366822 100644
--- a/src/corelib/serialization/qxmlstream.g
+++ b/src/corelib/serialization/qxmlstream.g
@@ -1642,8 +1642,8 @@ entity_ref ::= AMPERSAND name SEMICOLON;
case $rule_number: {
sym(1).len += sym(2).len + 1;
QStringView reference = symView(2);
- if (entityHash.contains(reference)) {
- Entity &entity = entityHash[reference];
+ if (const auto it = entityHash.find(reference); it != entityHash.end()) {
+ Entity &entity = *it;
if (entity.unparsed) {
raiseWellFormedError(QXmlStream::tr("Reference to unparsed entity '%1'.").arg(reference));
} else {
@@ -1684,9 +1684,9 @@ pereference ::= PERCENT name SEMICOLON;
case $rule_number: {
sym(1).len += sym(2).len + 1;
QStringView reference = symView(2);
- if (parameterEntityHash.contains(reference)) {
+ if (const auto it = parameterEntityHash.find(reference); it != parameterEntityHash.end()) {
referenceToParameterEntityDetected = true;
- Entity &entity = parameterEntityHash[reference];
+ Entity &entity = *it;
if (entity.unparsed || entity.external) {
referenceToUnparsedEntityDetected = true;
} else {
@@ -1715,8 +1715,8 @@ entity_ref_in_attribute_value ::= AMPERSAND name SEMICOLON;
case $rule_number: {
sym(1).len += sym(2).len + 1;
QStringView reference = symView(2);
- if (entityHash.contains(reference)) {
- Entity &entity = entityHash[reference];
+ if (const auto it = entityHash.find(reference); it != entityHash.end()) {
+ Entity &entity = *it;
if (entity.unparsed || entity.value.isNull()) {
raiseWellFormedError(QXmlStream::tr("Reference to external entity '%1' in attribute value.").arg(reference));
break;