From fb7814e2ec275fd30f0b07a70750c1f93022302f Mon Sep 17 00:00:00 2001 From: Yury Melnichek Date: Tue, 17 May 2011 21:14:31 +0200 Subject: [PATCH] Remove bitset.hpp. --- base/base.pro | 1 - base/bitset.hpp | 38 -------------------------------------- indexer/interval_index.hpp | 1 - 3 files changed, 40 deletions(-) delete mode 100644 base/bitset.hpp diff --git a/base/base.pro b/base/base.pro index 8c64b168be..8a3b772c15 100644 --- a/base/base.pro +++ b/base/base.pro @@ -64,4 +64,3 @@ HEADERS += \ path_utils.hpp \ array_adapters.hpp \ utf8_string.hpp \ - bitset.hpp \ diff --git a/base/bitset.hpp b/base/bitset.hpp deleted file mode 100644 index 65791bd0f7..0000000000 --- a/base/bitset.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once -#include "assert.hpp" -#include "base.hpp" -#include "bits.hpp" -#include "../std/memcpy.hpp" - -template class Bitset -{ -public: - Bitset() { memset(&m_Data, 0, sizeof(m_Data)); } - - // Returns 1 if bit and 0 otherwise. - uint8_t Bit(uint32_t offset) const - { - ASSERT_LESS(offset, kBytes, ()); - return (m_Data[offset >> 3] >> (offset & 7)) & 1; - } - - void SetBit(uint32_t offset, bool bSet = true) - { - ASSERT_LESS(offset, kBytes, ()); - if (bSet) - m_Data[offset >> 3] |= (1 << (offset & 7)); - else - m_Data[offset >> 3] &= !(1 << (offset & 7)); - } - - uint32_t PopCount() const - { - uint32_t res = 0; - for (size_t i = 0; i < kBytes; ++i) - res += bits::popcount(m_Data[i]); - return res; - } - -private: - uint8_t m_Data[kBytes]; -}; diff --git a/indexer/interval_index.hpp b/indexer/interval_index.hpp index 35301eb7a4..ca127973ec 100644 --- a/indexer/interval_index.hpp +++ b/indexer/interval_index.hpp @@ -6,7 +6,6 @@ #include "../base/assert.hpp" #include "../base/base.hpp" #include "../base/bits.hpp" -#include "../base/bitset.hpp" #include "../base/buffer_vector.hpp" #include "../base/macros.hpp" #include "../std/algorithm.hpp"