LibACPI: Finalize an operand by moving the object into the frame

This avoids a copy.
This commit is contained in:
Undefine authored and Sönke Holz committed 2026-11-07 13:27:30 +01:00
1 parent 7d59d6911d
commit 1895e5e413
3 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -513,7 +513,7 @@ ErrorOr<IterationDecision> Interpreter::cycle(TableStream& stream)
DEBUG_LOG("Finalizing argument {}", top_frame_value.opcode());
auto value = TRY(finalize_value_opcode(top_frame_value));
TRY(m_opcode_frames.last().finish_operand(value, stream.offset()));
TRY(m_opcode_frames.last().finish_operand(move(value), stream.offset()));
m_state = State::ReadingOperand;
} else {
+2 -2
View File
@@ -223,9 +223,9 @@ ErrorOr<void> OpcodeFrame::finish_operand(size_t current_offset)
return {};
}
ErrorOr<void> OpcodeFrame::finish_operand(Object const& operand, size_t current_offset)
ErrorOr<void> OpcodeFrame::finish_operand(Object&& operand, size_t current_offset)
{
TRY(m_operands.try_append(operand));
TRY(m_operands.try_append(move(operand)));
return finish_operand(current_offset);
}
+1 -1
View File
@@ -44,7 +44,7 @@ public:
ErrorOr<OperandType> begin_operand(size_t current_offset);
ErrorOr<void> finish_operand(size_t current_offset);
ErrorOr<void> finish_operand(Object const& operand, size_t current_offset);
ErrorOr<void> finish_operand(Object&& operand, size_t current_offset);
Object& operand(size_t index) { return m_operands[index]; }
Object const& operand(size_t index) const { return m_operands[index]; }