From 491d5e648bb18842124e33adc3f3e80e51ff87fd Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Tue, 19 May 2015 10:28:23 +0300 Subject: [PATCH] config: Unify ks_meta_data::new_keyspace() functions Use default argument to unify the two new_keyspace() function variants. Signed-off-by: Pekka Enberg --- config/ks_meta_data.cc | 12 ++++++------ config/ks_meta_data.hh | 10 ++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/config/ks_meta_data.cc b/config/ks_meta_data.cc index 9954e7e431..98722e5d5b 100644 --- a/config/ks_meta_data.cc +++ b/config/ks_meta_data.cc @@ -69,12 +69,12 @@ ks_meta_data::ks_meta_data(sstring name_, } } -// For new user created keyspaces (through CQL) -lw_shared_ptr ks_meta_data::new_keyspace(sstring name, sstring strategy_name, std::unordered_map options, bool durable_writes) { - return new_keyspace(name, strategy_name, options, durable_writes, std::vector{}); -} - -lw_shared_ptr ks_meta_data::new_keyspace(sstring name, sstring strategy_name, std::unordered_map options, bool durables_writes, std::vector cf_defs) +lw_shared_ptr +ks_meta_data::new_keyspace(sstring name, + sstring strategy_name, + std::unordered_map options, + bool durables_writes, + std::vector cf_defs) { return ::make_lw_shared(name, strategy_name, options, durables_writes, cf_defs, ::make_shared()); } diff --git a/config/ks_meta_data.hh b/config/ks_meta_data.hh index 8e2121ed92..7c6a150b40 100644 --- a/config/ks_meta_data.hh +++ b/config/ks_meta_data.hh @@ -64,10 +64,12 @@ public: std::vector cf_defs, shared_ptr user_types_); - // For new user created keyspaces (through CQL) - static lw_shared_ptr new_keyspace(sstring name, sstring strategy_name, std::unordered_map options, bool durable_writes); - - static lw_shared_ptr new_keyspace(sstring name, sstring strategy_name, std::unordered_map options, bool durables_writes, std::vector cf_defs); + static lw_shared_ptr + new_keyspace(sstring name, + sstring strategy_name, + std::unordered_map options, + bool durables_writes, + std::vector cf_defs = std::vector{}); const std::unordered_map& cf_meta_data() const { return _cf_meta_data;