QDomNode: don't needlessly call virtual functions
authorMarc Mutz <marc.mutz@kdab.com>
Mon, 27 Feb 2012 23:11:28 +0000 (00:11 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 28 Feb 2012 10:54:52 +0000 (11:54 +0100)
commit3518db0bbecd2b10fac714e006f52d66a4f7a992
tree95584a394d893aa3fed6167f0d74cc392dcf331d
parentf220f99a6d13a395ca723e9f923b16ef9ac9716b
QDomNode: don't needlessly call virtual functions

Commit 4dabe78387d10495f9f6d0a7395f2ba3c80432bd changed
these functions from virtuals to inlines that check the
return value of the remaining virtual function nodeType().

However, two of the functions call nodeType() more than
once, which we know will return the same result each time,
but requires a compiler with interprocedural optimization
capabilities to figure out by itself.

So instead of repeatedly calling nodeType(), call it once
and store its return value in a temporary, and use the
temp for further comparisions.

Change-Id: Idbeafb7fd93d275d475218c6df2ad7fdc9162cc5
Reviewed-by: Richard J. Moore <rich@kde.org>
src/xml/dom/qdom.cpp