Simplify code according to review feedback.
@@ -788,17 +788,15 @@ void
AttributeVector::update_config(const Config& cfg)
{
commit(true);
- bool compaction_strategy_changed = (cfg.getCompactionStrategy() != _config.getCompactionStrategy());
- if (compaction_strategy_changed) {
- drain_hold(1024 * 1024); // Wait until 1MiB or less on hold
- }
_config.setGrowStrategy(cfg.getGrowStrategy());
+ if (cfg.getCompactionStrategy() == _config.getCompactionStrategy()) {
+ return;
+ }
+ drain_hold(1024 * 1024); // Wait until 1MiB or less on hold
_config.setCompactionStrategy(cfg.getCompactionStrategy());
- if (compaction_strategy_changed) {
commit(); // might trigger compaction
drain_hold(1024 * 1024); // Wait until 1MiB or less on hold
}
-}
template bool AttributeVector::append<StringChangeData>(ChangeVectorT< ChangeTemplate<StringChangeData> > &changes, uint32_t , const StringChangeData &, int32_t, bool);
template bool AttributeVector::update<StringChangeData>(ChangeVectorT< ChangeTemplate<StringChangeData> > &changes, uint32_t , const StringChangeData &);
