Reduce function call overhead

The arg() function of the QString class has a variable length argument
which allows to reduce the number of chained calls to the same function.
With proper formatting, readability is not affected.
This commit is contained in:
Gianluca Recchia committed 2018-10-31 14:23:06 +01:00
1 parent 18fd20f898
commit a67a574b89
8 files changed
+30 -40

No files matched your search

+4 -4
View File
@@ -309,10 +309,10 @@ void KMessageWidget::setMessageType(KMessageWidget::MessageType type)
"}"
".QLabel { color: %6; }"
))
.arg(bg0.name())
.arg(bg1.name())
.arg(bg2.name())
.arg(border.name())
.arg(bg0.name(),
bg1.name(),
bg2.name(),
border.name())
// DefaultFrameWidth returns the size of the external margin + border width. We know our border is 1px,
// so we subtract this from the frame normal QStyle FrameWidth to get our margin
.arg(style()->pixelMetric(QStyle::PM_DefaultFrameWidth, nullptr, this) - 1)