optimized operator[] (branchless)

This commit is contained in:
masterexplorer 2024-08-27 10:53:44 +02:00
parent 3370929d81
commit 2b12b5c970
2 changed files with 2 additions and 5 deletions

View File

@ -31,11 +31,7 @@ public:
}
inline int& operator[](uint32_t i) noexcept {
if(i < mid) {
return old[i];
} else {
return nex[i];
}
return (i < mid) ? old[i] : nex[i];
}
inline void insert(int elem) noexcept {

View File

@ -7,6 +7,7 @@
#include"TurboList.hpp"
// #define PRINT_DBG
// #define N 65535
#define N 65535000
static inline size_t ms_now() noexcept {