mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-26 01:44:48 +00:00
Add bugprone-use-after-move
It's generally bad practice to use something after it's been std::moved from.
This commit is contained in:
parent
121196eb70
commit
af82672ca9
@ -1,4 +1,4 @@
|
||||
---
|
||||
Checks: '-*,modernize-use-nullptr,performance-unnecessary-value-param'
|
||||
Checks: '-*,bugprone-use-after-move,modernize-use-nullptr,performance-unnecessary-value-param'
|
||||
WarningsAsErrors: true
|
||||
...
|
||||
|
@ -370,7 +370,6 @@ void story_viewer::draw_floating_image(floating_image_list::const_iterator image
|
||||
image["name"] = floating_image.file();
|
||||
config cfg{"image", std::move(image)};
|
||||
|
||||
cfg.add_child("image", std::move(image));
|
||||
window_canvas.append_cfg(std::move(cfg));
|
||||
|
||||
// Needed to make the background redraw correctly.
|
||||
|
@ -130,12 +130,13 @@ unsigned pane::create_item(const widget_data& item_data,
|
||||
}
|
||||
}
|
||||
|
||||
const auto item_id = item.id;
|
||||
items_.push_back(std::move(item));
|
||||
|
||||
event::message message;
|
||||
fire(event::REQUEST_PLACEMENT, *this, message);
|
||||
|
||||
return item.id;
|
||||
return item_id;
|
||||
}
|
||||
|
||||
void pane::place(const point& origin, const point& size)
|
||||
|
@ -918,7 +918,7 @@ void generate_races_sections(const config* help_cfg, section& sec, int level)
|
||||
bool process_queue_again = true;
|
||||
while(process_queue_again && !taxonomy_queue.empty()) {
|
||||
process_queue_again = false;
|
||||
std::vector<taxonomy_queue_type> to_process = std::move(taxonomy_queue);
|
||||
auto to_process = std::exchange(taxonomy_queue, {});
|
||||
|
||||
for(auto& x : to_process) {
|
||||
auto parent = find_section(sec, x.parent_id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user