Skip to content

Commit

Permalink
api: minor optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Mar 13, 2024
1 parent ab9c72a commit 1a86735
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/builtin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace jule
{
if (dest._len + n > dest._cap)
{
const jule::Int alloc_size = (dest._len + n) * 2;
const jule::Int alloc_size = (dest._len + n) << 1;
jule::Slice<Item> buffer = jule::Slice<Item>::alloc(0, alloc_size);
buffer._len = dest._len;
std::move(
Expand Down
2 changes: 1 addition & 1 deletion api/slice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ namespace jule
if (this->_len == this->_cap)
{
jule::Slice<Item> _new;
_new.alloc_new(this->_len + 1, (this->_len + 1) * 2);
_new.alloc_new(this->_len + 1, (this->_len + 1) << 1);
std::move(
this->_slice,
this->_slice + this->_len,
Expand Down

0 comments on commit 1a86735

Please sign in to comment.