summaryrefslogtreecommitdiffstats
path: root/src/corelib/mimetypes/qmimeglobpattern_p.h
diff options
context:
space:
mode:
authorAnton Kudryavtsev <antkudr@mail.ru>2017-03-27 22:51:46 +0300
committerAnton Kudryavtsev <antkudr@mail.ru>2017-03-28 04:01:41 +0000
commited96363d56b912dc828537549a8028c8ad4ea3bb (patch)
tree927ddb92bbc5662600853c919577d01babcc77d0 /src/corelib/mimetypes/qmimeglobpattern_p.h
parente0e717d06a9da75474c6550e163d0d2ca18c258a (diff)
QMimeGlobPattern: init all members only once
... by initializer list. Change-Id: I39d2f933dac171273f500963eb47ffa9165978de Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/mimetypes/qmimeglobpattern_p.h')
-rw-r--r--src/corelib/mimetypes/qmimeglobpattern_p.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/corelib/mimetypes/qmimeglobpattern_p.h b/src/corelib/mimetypes/qmimeglobpattern_p.h
index c8b70464fd..21332e71bc 100644
--- a/src/corelib/mimetypes/qmimeglobpattern_p.h
+++ b/src/corelib/mimetypes/qmimeglobpattern_p.h
@@ -83,11 +83,9 @@ public:
static const unsigned MinWeight = 1;
explicit QMimeGlobPattern(const QString &thePattern, const QString &theMimeType, unsigned theWeight = DefaultWeight, Qt::CaseSensitivity s = Qt::CaseInsensitive) :
- m_pattern(thePattern), m_mimeType(theMimeType), m_weight(theWeight), m_caseSensitivity(s)
+ m_pattern(s == Qt::CaseInsensitive ? thePattern.toLower() : thePattern),
+ m_mimeType(theMimeType), m_weight(theWeight), m_caseSensitivity(s)
{
- if (s == Qt::CaseInsensitive) {
- m_pattern = m_pattern.toLower();
- }
}
void swap(QMimeGlobPattern &other) Q_DECL_NOTHROW