Skip to content

Commit

Permalink
api: minor optimization for string literals
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Aug 11, 2024
1 parent 980a933 commit 8ff57ae
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions api/str.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ namespace jule
static jule::Str lit(const char *s, const jule::Int n) noexcept
{
jule::Str str;
str.buffer = jule::Str::buffer_t::make(
const_cast<jule::U8 *>(reinterpret_cast<const jule::U8 *>(s)), nullptr);
str._slice = str.buffer.alloc;
str._slice = const_cast<jule::U8 *>(reinterpret_cast<const jule::U8 *>(s));
str._len = n;
return str;
}
Expand Down

0 comments on commit 8ff57ae

Please sign in to comment.