Skip to content

Commit

Permalink
api: remove outdated slice api
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Nov 22, 2024
1 parent 30903d4 commit 4e25222
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions api/slice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,6 @@ namespace jule
return buffer;
}

static jule::Slice<Item> alloc(const jule::Int &len, const jule::Int &cap, const Item &def) noexcept
{
if (len < 0)
__jule_panic((jule::U8 *)"runtime: []T: slice allocation length lower than zero", 53);
if (cap < 0)
__jule_panic((jule::U8 *)"runtime: []T: slice allocation capacity lower than zero", 55);
if (len > cap)
__jule_panic((jule::U8 *)"runtime: []T: slice allocation length greater than capacity", 59);
jule::Slice<Item> buffer;
buffer.alloc_new(len, cap, def);
return buffer;
}

static jule::Slice<Item> make(const std::initializer_list<Item> &src)
{
if (src.size() == 0)
Expand Down Expand Up @@ -176,15 +163,6 @@ namespace jule
this->_slice = alloc;
}

void alloc_new(const jule::Int &len, const jule::Int &cap, const Item &def) noexcept
{
this->alloc_new(len, cap);

// Initialize elements.
for (jule::Int i = 0; i < len; ++i)
*(this->_slice + i) = def;
}

using Iterator = Item *;
using ConstIterator = const Item *;

Expand Down

0 comments on commit 4e25222

Please sign in to comment.