cleanup: Get rid of trivial fn that's only used in one place
Move the logic into the function that used to call it.
This commit is contained in:
1 parent
f1f1d4259c
commit
02843f14ff
2 files changed
+3
-11
No files matched your search
@@ -215,7 +215,9 @@ const Security *SecurityCache::get_security(SecurityKey key) {
|
||||
if (security) {
|
||||
LOG(md, Info, "Loaded security from database: {} {}",
|
||||
security->symbol(), security->id());
|
||||
return add_db_security(security);
|
||||
return _me->cache.lock([&security](SecurityCacheIndex &cache) {
|
||||
return cache.add_db_security(security);
|
||||
});
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -269,15 +271,6 @@ std::vector<api::Security const *> SecurityCache::get_securities() {
|
||||
return result;
|
||||
}
|
||||
|
||||
const Security *SecurityCache::add_db_security(const SecurityPtr &security) {
|
||||
bts_assert(security);
|
||||
LOG(md, Info, "SecurityCache::add_db_security security: {}",
|
||||
bts::securities::descriptor(*security));
|
||||
return _me->cache.lock([&security](SecurityCacheIndex &cache) {
|
||||
return cache.add_db_security(security);
|
||||
});
|
||||
}
|
||||
|
||||
bool SecurityCache::add_live_security(const SecurityPtr &security) {
|
||||
bts_assert(security);
|
||||
LOG(md, Diag, "SecurityCache::add_live_security security: {}",
|
||||
|
||||
Reference in new issue
Block a user