Skip to content

Commit

Permalink
Small change to directly transfrom to Id when reading gap encoded list
Browse files Browse the repository at this point in the history
  • Loading branch information
Flixtastic committed Jan 19, 2025
1 parent b93312a commit 464a6fb
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/index/IndexImpl.Text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,15 +574,15 @@ IdTable IndexImpl::readWordCl(
const TextBlockMetaData& tbmd,
const ad_utility::AllocatorWithLimit<Id>& allocator) const {
IdTable idTable{3, allocator};
vector<TextRecordIndex> cids =
textIndexReadWrite::readGapComprList<TextRecordIndex, uint64_t>(
tbmd._cl._nofElements, tbmd._cl._startContextlist,
static_cast<size_t>(tbmd._cl._startWordlist -
tbmd._cl._startContextlist),
textIndexFile_, &TextRecordIndex::make);
vector<Id> cids = textIndexReadWrite::readGapComprList<Id, uint64_t>(
tbmd._cl._nofElements, tbmd._cl._startContextlist,
static_cast<size_t>(tbmd._cl._startWordlist - tbmd._cl._startContextlist),
textIndexFile_, [](uint64_t textRecordIndex) {
return Id::makeFromTextRecordIndex(
TextRecordIndex::make(textRecordIndex));
});
idTable.resize(cids.size());
ql::ranges::transform(cids, idTable.getColumn(0).begin(),
&Id::makeFromTextRecordIndex);
ql::ranges::copy(cids, idTable.getColumn(0).begin());
ql::ranges::copy(
textIndexReadWrite::readFreqComprList<Id, WordIndex>(
tbmd._cl._nofElements, tbmd._cl._startWordlist,
Expand All @@ -607,15 +607,15 @@ IdTable IndexImpl::readWordEntityCl(
const TextBlockMetaData& tbmd,
const ad_utility::AllocatorWithLimit<Id>& allocator) const {
IdTable idTable{3, allocator};
vector<TextRecordIndex> cids =
textIndexReadWrite::readGapComprList<TextRecordIndex, uint64_t>(
tbmd._entityCl._nofElements, tbmd._entityCl._startContextlist,
static_cast<size_t>(tbmd._entityCl._startWordlist -
tbmd._entityCl._startContextlist),
textIndexFile_, &TextRecordIndex::make);
vector<Id> cids = textIndexReadWrite::readGapComprList<Id, uint64_t>(
tbmd._cl._nofElements, tbmd._cl._startContextlist,
static_cast<size_t>(tbmd._cl._startWordlist - tbmd._cl._startContextlist),
textIndexFile_, [](uint64_t textRecordIndex) {
return Id::makeFromTextRecordIndex(
TextRecordIndex::make(textRecordIndex));
});
idTable.resize(cids.size());
ql::ranges::transform(cids, idTable.getColumn(0).begin(),
&Id::makeFromTextRecordIndex);
ql::ranges::copy(cids, idTable.getColumn(0).begin());
ql::ranges::copy(
textIndexReadWrite::readFreqComprList<Id, WordIndex>(
tbmd._entityCl._nofElements, tbmd._entityCl._startWordlist,
Expand Down

0 comments on commit 464a6fb

Please sign in to comment.