From 296eff7c5de743eb4ec6ef8b16bd116387331dbe Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 17 May 2018 19:20:30 -0700 Subject: [PATCH] ircd::db: Removed unused cell features. --- include/ircd/db/cell.h | 4 ---- ircd/db.cc | 40 ---------------------------------------- 2 files changed, 44 deletions(-) diff --git a/include/ircd/db/cell.h b/include/ircd/db/cell.h index d96827fa2..5bfdfc4be 100644 --- a/include/ircd/db/cell.h +++ b/include/ircd/db/cell.h @@ -76,10 +76,6 @@ struct ircd::db::cell // [SET] assign cell cell &operator=(const string_view &); - // [GET] -> [SET] assign cell (atomic) - bool compare_exchange(string_view &expected, const string_view &desired); - string_view exchange(const string_view &desired); - // [GET] load cell only (returns valid) bool load(const string_view &index = {}, gopts = {}); diff --git a/ircd/db.cc b/ircd/db.cc index 41db6af13..1f2febb5f 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -3462,50 +3462,10 @@ ircd::db::cell::load(const string_view &index, this->ss = std::move(opts.snapshot); } - std::unique_ptr tit; - throw_on_error(d.d->GetUpdatesSince(0, &tit)); - while(tit && tit->Valid()) - { - auto batchres(tit->GetBatch()); - //std::cout << "seq: " << batchres.sequence; - if(batchres.writeBatchPtr) - { - auto &batch(*batchres.writeBatchPtr); - //std::cout << " count " << batch.Count() << " ds: " << batch.GetDataSize() << " " << batch.Data() << std::endl; - } - - tit->Next(); - } - database::column &c(this->c); return seek(c, index, opts, this->it); } -ircd::string_view -ircd::db::cell::exchange(const string_view &desired) -{ - const auto ret(val()); - (*this) = desired; - return ret; -} - -bool -ircd::db::cell::compare_exchange(string_view &expected, - const string_view &desired) -{ - const auto existing(val()); - if(expected.size() != existing.size() || - memcmp(expected.data(), existing.data(), expected.size()) != 0) - { - expected = existing; - return false; - } - - expected = existing; - (*this) = desired; - return true; -} - ircd::db::cell & ircd::db::cell::operator=(const string_view &s) {