mirror of
https://github.com/azahar-emu/dynarmic
synced 2025-11-07 23:50:00 +01:00
ir/basic_block: std::move Terminal within SetTerminal and ReplaceTerminal
A terminal isn't a trivial type (and boost::variant is allowed to heap allocate), so we can std::move it here to avoid a redundant copy.
This commit is contained in:
parent
63eff4e7cc
commit
b79ce71b0f
@ -102,12 +102,12 @@ Terminal Block::GetTerminal() const {
|
|||||||
|
|
||||||
void Block::SetTerminal(Terminal term) {
|
void Block::SetTerminal(Terminal term) {
|
||||||
ASSERT_MSG(!HasTerminal(), "Terminal has already been set.");
|
ASSERT_MSG(!HasTerminal(), "Terminal has already been set.");
|
||||||
terminal = term;
|
terminal = std::move(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Block::ReplaceTerminal(Terminal term) {
|
void Block::ReplaceTerminal(Terminal term) {
|
||||||
ASSERT_MSG(HasTerminal(), "Terminal has not been set.");
|
ASSERT_MSG(HasTerminal(), "Terminal has not been set.");
|
||||||
terminal = term;
|
terminal = std::move(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Block::HasTerminal() const {
|
bool Block::HasTerminal() const {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user