use @bitsizeof()
This commit is contained in:
parent
bafadae1e0
commit
14e0a6ad0a
@ -96,8 +96,7 @@ fn void Cache.remove(&cache, Key id)
|
|||||||
/* If there is no free space left then just return the first position */
|
/* If there is no free space left then just return the first position */
|
||||||
fn usz Cache.get_free_spot(&cache)
|
fn usz Cache.get_free_spot(&cache)
|
||||||
{
|
{
|
||||||
// TODO: in the upgrade to c3 1.7.5 use @bitsof()
|
const BITS = @bitsizeof(cache.present.data[0]);
|
||||||
const BITS = $typeof(cache.present.data[0]).sizeof*8;
|
|
||||||
foreach (idx, d: cache.present.data) {
|
foreach (idx, d: cache.present.data) {
|
||||||
if (d != $typeof(d).max) {
|
if (d != $typeof(d).max) {
|
||||||
usz spot = idx*BITS + BITS-d.clz();
|
usz spot = idx*BITS + BITS-d.clz();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user