Skip to content

Commit

Permalink
Changed from size_t to uint8_t to save memory
Browse files Browse the repository at this point in the history
  • Loading branch information
stmonty committed Dec 7, 2024
1 parent b68c29b commit 6c1d279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler+runtime/src/cpp/jank/read/lex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace jank::read
struct codepoint
{
char32_t character{};
size_t len{};
uint8_t len{};
};

native_bool ratio::operator==(ratio const &rhs) const
Expand Down Expand Up @@ -281,7 +281,7 @@ namespace jank::read
{
return err(error{ pos, "Invalid character" });
}
return ok(codepoint{ static_cast<char32_t>(wc), len });
return ok(codepoint{ static_cast<char32_t>(wc), static_cast<uint8_t>(len) });
}

static native_bool is_utf8_char(char32_t const c)
Expand Down

0 comments on commit 6c1d279

Please sign in to comment.