Skip to content

Commit ac44d4a

Browse files
author
matthias
committed
WT-11772: Resolve some Wredundant-move warnings
These warnings are the result of unnecessary `std::move` calls. The unique pointer is constructed in a class method, but as an lvalue. So the ownership never is assigned to the class, due to copy elision.
1 parent 9a2e2a4 commit ac44d4a

File tree

11 files changed

+11
-15
lines changed

11 files changed

+11
-15
lines changed

src/Wt/Auth/AuthWidget.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ std::unique_ptr<WWidget> AuthWidget::createRegistrationView(const Identity& id)
211211

212212
std::unique_ptr<RegistrationWidget> w(new RegistrationWidget(this));
213213
w->setModel(std::move(model));
214-
return std::move(w);
214+
return w;
215215
}
216216

217217
void AuthWidget::letResendEmailVerification()
@@ -371,7 +371,7 @@ std::unique_ptr<WWidget> AuthWidget::createFormWidget(WFormModel::Field field)
371371
result.reset(new WCheckBox());
372372
}
373373

374-
return std::move(result);
374+
return result;
375375
}
376376

377377
void AuthWidget::updatePasswordLoginView()

src/Wt/Auth/RegistrationWidget.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ std::unique_ptr<WWidget> RegistrationWidget
9292
result.reset(p);
9393
}
9494

95-
return std::move(result);
95+
return result;
9696
}
9797

9898
void RegistrationWidget::update()

src/Wt/Auth/UpdatePasswordWidget.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ std::unique_ptr<WWidget> UpdatePasswordWidget
111111
result.reset(p);
112112
}
113113

114-
return std::move(result);
114+
return result;
115115
}
116116

117117
void UpdatePasswordWidget::checkPassword()

src/Wt/Chart/WCartesianChart.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,7 @@ std::unique_ptr<WWidget> WCartesianChart::createLegendItemWidget(int index)
19761976
label->setVerticalAlignment(AlignmentFlag::Top);
19771977
legendItem->addWidget(std::move(label));
19781978

1979-
return std::move(legendItem);
1979+
return legendItem;
19801980
}
19811981

19821982
void WCartesianChart::addDataPointArea(WT_MAYBE_UNUSED const WDataSeries& series,

src/Wt/Chart/WPieChart.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ WPieChart::createLegendItemWidget(int index, WFlags<LabelOption> options)
175175
}
176176
}
177177

178-
return std::move(legendItem);
178+
return legendItem;
179179
}
180180

181181
void WPieChart::paint(WPainter& painter, const WRectF& rectangle) const

src/Wt/WAbstractItemView.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ std::unique_ptr<WWidget> WAbstractItemView::createHeaderWidget(int column)
12451245
if (!sc.empty())
12461246
result->addStyleClass(sc);
12471247

1248-
return std::move(result);
1248+
return result;
12491249
}
12501250

12511251
void WAbstractItemView::enableAjax()

src/Wt/WBoxLayout.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ std::unique_ptr<WWidget> WBoxLayout::createSpacer(const WLength& size)
277277
spacer->setMinimumSize(WLength::Auto, size);
278278
}
279279

280-
return std::move(spacer);
280+
return spacer;
281281
}
282282

283283
void WBoxLayout::setResizable(int index, bool enabled,

src/Wt/WClientGLWidget.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ std::unique_ptr<WResource> WClientGLWidget::rpdToMemResource(WRasterImage *rpd)
12061206
std::unique_ptr<WMemoryResource> mr(new WMemoryResource("image/png"));
12071207
mr->setData(reinterpret_cast<const unsigned char*>(ss.str().c_str()),
12081208
ss.str().size());
1209-
return std::move(mr);
1209+
return mr;
12101210
}
12111211
#endif
12121212

src/Wt/WDoubleSpinBox.C

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,7 @@ std::unique_ptr<WValidator> WDoubleSpinBox::createValidator()
127127
std::unique_ptr<WDoubleValidator> validator(new WDoubleValidator());
128128
validator->setMandatory(true);
129129
validator->setRange(min_, max_);
130-
#ifndef WT_TARGET_JAVA
131-
return std::move(validator); // FreeBSD wanted this std::move
132-
#else // WT_TARGET_JAVA
133130
return validator;
134-
#endif // WT_TARGET_JAVA
135131
}
136132

137133
WT_USTRING WDoubleSpinBox::textFromValue() const

src/Wt/WItemDelegate.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ std::unique_ptr<WWidget> WItemDelegate
437437
WLength(100, LengthUnit::Percentage)); //for Konqueror
438438
result->addWidget(std::move(lineEdit));
439439

440-
return std::move(result);
440+
return result;
441441
}
442442

443443
void WItemDelegate::doCloseEditor(WWidget *editor, bool save) const

0 commit comments

Comments
 (0)