mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
LibACPI: Finalize an operand by moving the object into the frame
This avoids a copy.
This commit is contained in:
1 parent
7d59d6911d
commit
1895e5e413
3 files changed
+4
-4
No files matched your search
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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]; }
|
||||
|
||||
Reference in new issue
Block a user