We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
__jule_Array
1 parent 360cb04 commit 104b179Copy full SHA for 104b179
1 file changed
api/array.hpp
@@ -57,18 +57,11 @@ template <typename Item, __jule_Int N> struct __jule_Array {
57
if (start == end) {
58
return __jule_Slice<Item>();
59
}
60
-
61
__jule_Slice<Item> slice;
62
slice.alloc_new(0, end - start);
63
slice._len = slice._cap;
64
65
- Item *s_it = slice.begin();
66
- __jule_Array<Item, N>::ConstIterator a_it = this->begin() + start;
67
- __jule_Array<Item, N>::ConstIterator a_end = this->begin() + end;
68
- while (a_it < a_end) {
69
- *s_it++ = *a_it++;
70
- }
71
+ (void)std::copy(this->begin() + start, this->begin() + end,
+ slice.begin());
72
return slice;
73
74
0 commit comments