From 4e2522280ff436d4b0313a87079e546b5800aaca Mon Sep 17 00:00:00 2001 From: mertcandav Date: Fri, 22 Nov 2024 14:26:53 +0300 Subject: [PATCH] api: remove outdated slice api --- api/slice.hpp | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/api/slice.hpp b/api/slice.hpp index 27954ad3..1ac763c2 100644 --- a/api/slice.hpp +++ b/api/slice.hpp @@ -42,19 +42,6 @@ namespace jule return buffer; } - static jule::Slice 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 buffer; - buffer.alloc_new(len, cap, def); - return buffer; - } - static jule::Slice make(const std::initializer_list &src) { if (src.size() == 0) @@ -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 *;