mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-16 14:18:00 +00:00
Lint for performance-move-constructor-init
This checks when a move constructor for an object copy constructs its member classes or parent classes. Copying unnecessary as all of the members of the moved-from object can be clobbered by the move.
This commit is contained in:
parent
259160e1e4
commit
15acd0c00a
|
@ -1,4 +1,4 @@
|
|||
---
|
||||
Checks: '-*,bugprone-move-forwarding-reference,bugprone-use-after-move,cppcoreguidelines-rvalue-reference-param-not-moved,modernize-use-nullptr,performance-move-const-arg,performance-unnecessary-value-param'
|
||||
Checks: '-*,bugprone-move-forwarding-reference,bugprone-use-after-move,cppcoreguidelines-rvalue-reference-param-not-moved,modernize-use-nullptr,performance-move-const-arg,performance-move-constructor-init,performance-unnecessary-value-param''
|
||||
WarningsAsErrors: true
|
||||
...
|
||||
|
|
|
@ -361,10 +361,10 @@ terrain_label::terrain_label(const map_labels& parent, const config& cfg)
|
|||
terrain_label::terrain_label(terrain_label&& l)
|
||||
: handle_(l.handle_)
|
||||
, tooltip_handle_(l.tooltip_handle_)
|
||||
, text_(l.text_)
|
||||
, tooltip_(l.tooltip_)
|
||||
, category_(l.category_)
|
||||
, team_name_(l.team_name_)
|
||||
, text_(std::move(l.text_))
|
||||
, tooltip_(std::move(l.tooltip_))
|
||||
, category_(std::move(l.category_))
|
||||
, team_name_(std::move(l.team_name_))
|
||||
, visible_in_fog_(l.visible_in_fog_)
|
||||
, visible_in_shroud_(l.visible_in_shroud_)
|
||||
, immutable_(l.immutable_)
|
||||
|
|
|
@ -1225,7 +1225,7 @@ attack_type::specials_context_t::~specials_context_t()
|
|||
}
|
||||
|
||||
attack_type::specials_context_t::specials_context_t(attack_type::specials_context_t&& other)
|
||||
: parent(other.parent)
|
||||
: parent(std::move(other.parent))
|
||||
{
|
||||
other.was_moved = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user