Minor cleanups:

* Make sure variables are always initialized
* Use lround instead of adding .5 and casting
* Remove some unneeded vars
* Check for null before calling strcmp
* Remove redundant if conditions
* Remove make_TxQ factory function
This commit is contained in:
seelabs
2020-04-24 07:32:34 -07:00
committed by manojsdoshi
parent 6d28f2a8d9
commit 328e42ad42
11 changed files with 28 additions and 43 deletions

View File

@@ -588,7 +588,8 @@ public:
, m_loadManager(
make_LoadManager(*this, *this, logs_->journal("LoadManager")))
, txQ_(make_TxQ(setup_TxQ(*config_), logs_->journal("TxQ")))
, txQ_(
std::make_unique<TxQ>(setup_TxQ(*config_), logs_->journal("TxQ")))
, sweepTimer_(get_io_service())
@@ -1877,8 +1878,8 @@ ApplicationImp::fdRequired() const
// Standard handles, config file, misc I/O etc:
int needed = 128;
// 1.5 times the configured peer limit for peer connections:
needed += static_cast<int>(0.5 + (1.5 * overlay_->limit()));
// 2x the configured peer limit for peer connections:
needed += 2 * overlay_->limit();
// the number of fds needed by the backend (internally
// doubled if online delete is enabled).