From 5b99ac4eadfcc7c2cffce606c21415a242d8a83e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 31 May 2017 09:03:20 +0200 Subject: uic: standardize property lookups on QHash::value() This is the pattern used throughout the rest of the uic codebase, and is both more efficient (one lookup instead of two with an additional contains() call) and will allow porting to another container. In writeSpacerItem(), also gently optimize string handling. Change-Id: I20c7914089a699d2161d648b16d938e3a001ace3 Reviewed-by: Jarek Kobus --- src/tools/uic/databaseinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tools/uic/databaseinfo.cpp') diff --git a/src/tools/uic/databaseinfo.cpp b/src/tools/uic/databaseinfo.cpp index 73fcf06c54..fa5d5f5df0 100644 --- a/src/tools/uic/databaseinfo.cpp +++ b/src/tools/uic/databaseinfo.cpp @@ -52,11 +52,11 @@ void DatabaseInfo::acceptWidget(DomWidget *node) { QHash properties = propertyMap(node->elementProperty()); - DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode"), 0); + DomProperty *frameworkCode = properties.value(QLatin1String("frameworkCode")); if (frameworkCode && toBool(frameworkCode->elementBool()) == false) return; - DomProperty *db = properties.value(QLatin1String("database"), 0); + DomProperty *db = properties.value(QLatin1String("database")); if (db && db->elementStringList()) { QStringList info = db->elementStringList()->elementString(); -- cgit v1.2.3