Appended references to const auto type in loop to prevent copying.
This commit is contained in:
parent
f4cf3094c2
commit
beb09445d1
6 changed files with 6 additions and 6 deletions
|
|
@ -866,7 +866,7 @@ QImage GenerateLinearGradient(
|
|||
auto stops = QGradientStops();
|
||||
const auto step = 1. / (colors.size() - 1);
|
||||
auto point = 0.;
|
||||
for (const auto color : colors) {
|
||||
for (const auto &color : colors) {
|
||||
stops.append({ point, color });
|
||||
point += step;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -245,7 +245,7 @@ void BoxContent::paintEvent(QPaintEvent *e) {
|
|||
|
||||
if (testAttribute(Qt::WA_OpaquePaintEvent)) {
|
||||
const auto &color = getDelegate()->style().bg;
|
||||
for (const auto rect : e->region()) {
|
||||
for (const auto &rect : e->region()) {
|
||||
p.fillRect(rect, color);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ void BoxLayerWidget::paintEvent(QPaintEvent *e) {
|
|||
}
|
||||
auto other = e->region().intersected(QRect(0, st::boxRadius, width(), height() - 2 * st::boxRadius));
|
||||
if (!other.isEmpty()) {
|
||||
for (const auto rect : other) {
|
||||
for (const auto &rect : other) {
|
||||
p.fillRect(rect, st().bg);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ void LayerStackWidget::BackgroundWidget::paintEvent(QPaintEvent *e) {
|
|||
// in the transparent special layer cache corners after filling special layer
|
||||
// rect above its cache with alpha_current opacity.
|
||||
const auto region = QRegion(bg) - specialLayerBox;
|
||||
for (const auto rect : region) {
|
||||
for (const auto &rect : region) {
|
||||
p.fillRect(rect, st::layerBg);
|
||||
}
|
||||
p.setOpacity((bgOpacity - overSpecialOpacity) / (1. - (overSpecialOpacity * st::layerBg->c.alphaF())));
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace {
|
|||
auto result = TextWithEntities();
|
||||
result.text.reserve(text.size());
|
||||
auto afterAmpersand = false;
|
||||
for (const auto ch : text) {
|
||||
for (const auto &ch : text) {
|
||||
if (afterAmpersand) {
|
||||
afterAmpersand = false;
|
||||
if (ch == '&') {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ PopupMenu::PopupMenu(QWidget *parent, QMenu *menu, const style::PopupMenu &st)
|
|||
, _menu(this, menu, _st.menu) {
|
||||
init();
|
||||
|
||||
for (const auto action : actions()) {
|
||||
for (const auto &action : actions()) {
|
||||
if (const auto submenu = action->menu()) {
|
||||
_submenus.emplace(
|
||||
action,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue