treewide: require type for comparing cells

This commit is contained in:
Paweł Dziepak
2018-04-09 13:42:34 +02:00
parent aa25f0844f
commit 9bb1f10bb6
2 changed files with 6 additions and 3 deletions

View File

@@ -62,7 +62,7 @@ public:
bytes_view serialize() const {
return _data;
}
bool operator==(const atomic_cell_or_collection& other) const {
bool equals(const abstract_type& type, const atomic_cell_or_collection& other) const {
return _data == other._data;
}
size_t external_memory_usage(const abstract_type&) const {

View File

@@ -1513,8 +1513,11 @@ bool row::equal(column_kind kind, const schema& this_schema, const row& other, c
auto cells_equal = [&] (std::pair<column_id, const atomic_cell_or_collection&> c1,
std::pair<column_id, const atomic_cell_or_collection&> c2) {
static_assert(schema::row_column_ids_are_ordered_by_name::value, "Relying on column ids being ordered by name");
return this_schema.column_at(kind, c1.first).name() == other_schema.column_at(kind, c2.first).name()
&& c1.second == c2.second;
auto& at1 = *this_schema.column_at(kind, c1.first).type;
auto& at2 = other_schema.column_at(kind, c2.first).type;
return at1.equals(at2)
&& this_schema.column_at(kind, c1.first).name() == other_schema.column_at(kind, c2.first).name()
&& c1.second.equals(at1, c2.second);
};
return with_both_ranges(other, [&] (auto r1, auto r2) {
return boost::equal(r1, r2, cells_equal);