0dbbda670d
defaultMimeType() cannot be moved out of the class and defined in qmimedatabase.cpp, because it is called from QMimeType::isDefault() in qmimetype.cpp. Return m_defaultMimeType constant by reference rather than by value from the inline helper function. This eliminates useless copying of QString when calling code needs only a reference, and so improves performance. Even though m_defaultMimeType is initialized with a QStringLiteral and its QArrayDataPointer has d == nullptr, QArrayDataPointer's ref() and deref() still have to compare d with nullptr to decide that no reference count manipulation is needed. Compilers might be unable to reorder these checks with surrounding code because they guard reference count manipulation. Branch misprediction could further harm performance. Optimizing these checks out can be difficult for compilers. Change-Id: I3ffa0fdc5ad948452301dd9688073b5323a7983b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
conanfile.py | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
LICENSE.FDL | ||
LICENSE.GPL2 | ||
LICENSE.GPL3 | ||
LICENSE.GPL3-EXCEPT | ||
LICENSE.LGPL3 | ||
LICENSE.QT-LICENSE-AGREEMENT | ||
qt_cmdline.cmake | ||
sync.profile |