aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/common/bitword.cpp
blob: fbace5fcc56b3b1f6e0b95ac1c4e76fef687bf12 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "bitword.h"

namespace search {

namespace {

template <typename T>
void fillUp(T * v, T startVal) {
    for (size_t i(0); i < (sizeof(T)*8); i++) {
        v[i] = startVal << i;
    }
}

}

BitWord::Init BitWord::_initializer;

BitWord::Init::Init()
{
    fillUp(BitWord::_checkTab, std::numeric_limits<BitWord::Word>::max());
}

BitWord::Word BitWord::_checkTab[BitWord::WordLen];

}