Try to optimize RPN expressions with .emplace_back instead of .push_back

This commit is contained in:
Rangi42
2025-09-03 23:00:06 -04:00
parent c5d437ab3c
commit 4f702a4be8
2 changed files with 43 additions and 15 deletions

View File

@@ -16,6 +16,11 @@ struct RPNValue {
RPNCommand command; // The RPN_* command ID
std::variant<std::monostate, uint8_t, uint32_t, std::string> data; // Data after the ID, if any
RPNValue(RPNCommand cmd);
RPNValue(RPNCommand cmd, uint8_t val);
RPNValue(RPNCommand cmd, uint32_t val);
RPNValue(RPNCommand cmd, std::string const &name);
void appendEncoded(std::vector<uint8_t> &buffer) const;
};