-
Notifications
You must be signed in to change notification settings - Fork 179
Closed
Description
void ColumnString::Append(std::string_view str) {
if (blocks_.size() == 0 || blocks_.back().GetAvailble() < str.length())
{
blocks_.emplace_back(std::max(DEFAULT_BLOCK_SIZE, str.size()));
}
items_.emplace_back(blocks_.back().AppendUnsafe(str));
}
Always cpoy the str into the Block, this is not necessary. We can move the data into std::queue<std::string>
if the str is not useful any more.
I remeber a previous version use the std::vector<std::string>
to hold the str, but also use the cpoy. The code like :
void ColumnString::Append(const std::string& str) {
data_.push_back(str)
}
some advantage that i missed ?
Metadata
Metadata
Assignees
Labels
No labels