SLOW_BUILD, 2 additional build targets, improve word complete
This commit is contained in:
@@ -165,7 +165,7 @@ Slice<T> GetSlice(Slice<T> &arr, int64_t first_index = 0, int64_t one_past_last_
|
||||
}
|
||||
|
||||
// Make arrays resize on every item
|
||||
#define ARRAY_DEBUG 0
|
||||
#define ARRAY_DEBUG BUILD_SLOW
|
||||
#if ARRAY_DEBUG
|
||||
#define ARRAY_IF_DEBUG_ELSE(IF, ELSE) IF
|
||||
#else
|
||||
@@ -310,6 +310,16 @@ bool Contains(Array<T> &arr, T item) {
|
||||
return false;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
int64_t FindValueIndex(Array<T> &arr, T item) {
|
||||
for (int64_t i = 0; i < arr.len; i += 1) {
|
||||
if (arr.data[i] == item) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
int64_t GetIndex(Array<T> &arr, const T &item) {
|
||||
ptrdiff_t index = (ptrdiff_t)(&item - arr.data);
|
||||
|
||||
Reference in New Issue
Block a user