Refactor: remove DeleteAll interface
There is no need for ItemUpdater to implement DeleteAll interface,
remove it.
Also make Activation::versionId private and provide a public
getVersionId() method;
Make ItemUpdater::erase() to pass const reference.
Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: Ifd6c61fc21b2967d6c83f1df7aaa3b2e94cae86c
diff --git a/src/item_updater.cpp b/src/item_updater.cpp
index d9a502f..49b95df 100644
--- a/src/item_updater.cpp
+++ b/src/item_updater.cpp
@@ -123,7 +123,7 @@
return;
}
-void ItemUpdater::erase(std::string versionId)
+void ItemUpdater::erase(const std::string& versionId)
{
auto it = versions.find(versionId);
if (it == versions.end())
@@ -153,12 +153,6 @@
}
}
-void ItemUpdater::deleteAll()
-{
- // TODO: when PSU's running firmware is implemented, delete all versions
- // that are not the running firmware.
-}
-
void ItemUpdater::createActiveAssociation(const std::string& path)
{
assocs.emplace_back(
@@ -268,7 +262,7 @@
if (associations.empty())
{
// Remove the activation
- erase(activationPtr->versionId);
+ erase(activationPtr->getVersionId());
}
else
{