From e8ec4d2021de7c26ae49c09d8034ba202f4f5e41 Mon Sep 17 00:00:00 2001 From: hrzlgnm Date: Thu, 9 Nov 2023 23:24:43 +0100 Subject: [PATCH] dont pass smol primitives by ref --- source/code/code.cpp | 2 +- source/code/code.hpp | 2 +- source/lexer/token_type.cpp | 2 +- source/lexer/token_type.hpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/code/code.cpp b/source/code/code.cpp index a42e8a8..d496605 100644 --- a/source/code/code.cpp +++ b/source/code/code.cpp @@ -9,7 +9,7 @@ #include #include -auto operator<<(std::ostream& ostream, const opcodes& opcode) -> std::ostream& +auto operator<<(std::ostream& ostream, opcodes opcode) -> std::ostream& { using enum opcodes; switch (opcode) { diff --git a/source/code/code.hpp b/source/code/code.hpp index ec093da..1569b30 100644 --- a/source/code/code.hpp +++ b/source/code/code.hpp @@ -45,7 +45,7 @@ enum class opcodes : uint8_t current_closure, }; -auto operator<<(std::ostream& ostream, const opcodes& opcode) -> std::ostream&; +auto operator<<(std::ostream& ostream, opcodes opcode) -> std::ostream&; using operands = std::vector; using instructions = std::vector; diff --git a/source/lexer/token_type.cpp b/source/lexer/token_type.cpp index bad9cb6..0afa0cc 100644 --- a/source/lexer/token_type.cpp +++ b/source/lexer/token_type.cpp @@ -1,6 +1,6 @@ #include "token_type.hpp" -auto operator<<(std::ostream& ostream, const token_type& type) -> std::ostream& +auto operator<<(std::ostream& ostream, token_type type) -> std::ostream& { switch (type) { case token_type::asterisk: diff --git a/source/lexer/token_type.hpp b/source/lexer/token_type.hpp index ab5c16a..df9676d 100644 --- a/source/lexer/token_type.hpp +++ b/source/lexer/token_type.hpp @@ -55,4 +55,4 @@ enum class token_type ret, }; -auto operator<<(std::ostream& ostream, const token_type& type) -> std::ostream&; +auto operator<<(std::ostream& ostream, token_type type) -> std::ostream&;