db: abstract memtable empty test

This commit is contained in:
Avi Kivity
2015-05-21 15:48:51 +03:00
parent 068a3190d1
commit bbc8dbbab5
2 changed files with 2 additions and 1 deletions

View File

@@ -352,7 +352,7 @@ void column_family::add_memtable() {
void
column_family::seal_active_memtable() {
auto old = _memtables->back();
if (old->all_partitions().empty()) {
if (old->empty()) {
return;
}
add_memtable();

View File

@@ -30,4 +30,5 @@ public:
void apply(const mutation& m);
void apply(const frozen_mutation& m);
const partitions_type& all_partitions() const;
bool empty() const { return partitions.empty(); }
};