Code clean up

This commit is contained in:
Larry Luo 2022-07-19 16:57:33 -07:00
parent 1d9bf9962c
commit 514e17d037
5 changed files with 7 additions and 7 deletions

View File

@ -17,7 +17,7 @@ namespace ErrorCodes
extern const int LOGICAL_ERROR;
};
UInt16 Arc::serialize(WriteBuffer& write_buffer)
UInt16 Arc::serialize(WriteBuffer& write_buffer) const
{
UInt16 written_bytes = 0;
bool has_output = output != 0;
@ -71,8 +71,7 @@ int ArcsBitmap::getIndex(char label) const
int ArcsBitmap::getArcNum() const
{
int bit_count = 0;
for (size_t i = 0; i < 4; i++)
for (unsigned long item : data.items)
for (uint64_t item : data.items)
{
if (item)
bit_count += PopCountImpl(item);

View File

@ -24,7 +24,7 @@ struct Arc
Output output{0};
StatePtr target;
UInt16 serialize(WriteBuffer& write_buffer);
UInt16 serialize(WriteBuffer& write_buffer) const;
};
class ArcsBitmap

View File

@ -208,13 +208,14 @@ bool GinFilter::contains(const GinFilter & af, PostingsCacheForStore &cache_stor
if (postings_cache == nullptr)
{
GinIndexStoreReader reader(cache_store.store);
postings_cache = reader.loadPostingsIntoCache(af.getTerms());
cache_store.cache[af.getMatchString()] = postings_cache;
}
if (match(postings_cache))
{
return true;
}
return false;
}

View File

@ -32,7 +32,7 @@ public:
explicit GinFilter(const GinFilterParameters& params);
void add(const char* data, size_t len, UInt32 rowID, GinIndexStorePtr& store);
static void add(const char* data, size_t len, UInt32 rowID, GinIndexStorePtr& store);
void addRowRangeToGinFilter(UInt32 segmentID, UInt32 rowIDStart, UInt32 rowIDEnd);

View File

@ -29,7 +29,7 @@ bool GinIndexPostingsBuilder::contains(UInt32 row_id) const
if (useRoaring())
return bmp.contains(row_id);
const auto it(std::find(lst.begin(), lst.begin()+lst_length, row_id));
const auto *const it(std::find(lst.begin(), lst.begin()+lst_length, row_id));
return it != lst.begin()+lst_length;
}