mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-04 03:48:46 -05:00
[MOS-225] Review applied
As above.
This commit is contained in:
committed by
Adam Dobrowolski
parent
224f397370
commit
1fff92e9d6
@@ -5,22 +5,22 @@
|
||||
#include "SystemManager/cpu/algorithm/FrequencyHold.hpp"
|
||||
#include <memory>
|
||||
|
||||
namespace sys::cpu {
|
||||
namespace sys::cpu
|
||||
{
|
||||
|
||||
AlgorithmFactory::PutResult AlgorithmFactory::emplace(sys::cpu::AlgoID id, std::unique_ptr<Algorithm>&&algorithm)
|
||||
AlgorithmFactory::PutResult AlgorithmFactory::emplace(sys::cpu::AlgoID id, std::unique_ptr<Algorithm> &&algorithm)
|
||||
{
|
||||
if ( algorithms.find(id) != std::end(algorithms)) {
|
||||
if (algorithms.find(id) != std::end(algorithms)) {
|
||||
algorithms[id] = std::move(algorithm);
|
||||
return PutResult::Replaced;
|
||||
}
|
||||
return PutResult::Replaced;
|
||||
}
|
||||
algorithms.emplace(id, std::move(algorithm));
|
||||
return PutResult::Added;
|
||||
}
|
||||
|
||||
|
||||
Algorithm* AlgorithmFactory::get(sys::cpu::AlgoID id)
|
||||
Algorithm *AlgorithmFactory::get(sys::cpu::AlgoID id)
|
||||
{
|
||||
if ( auto el = algorithms.find(id); el != std::end(algorithms)) {
|
||||
if (auto el = algorithms.find(id); el != std::end(algorithms)) {
|
||||
return el->second.get();
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user