*/
inline bool bit_vector::unsafe_get(size_t idx) const
{
- return (_vector[idx / W] >> (idx % W)) & true;
+ size_t i = idx / W;
+ size_t j = idx % W;
+ return (_vector[i] >> (W - 1 - j)) & true;
};
/** Unsafe version of get_field. Does not perform bound checking.
*/
inline uint32_t bit_vector::unsafe_get_field(size_t idx, size_t len) const
{
+ //TODO FIX TO REFLECT BIG ENDIAN ORDER.
switch (len){
case 8:
return ((uint8_t*)_vector)[idx];