bmc: add utilty method to only add a blob id if not present
Signed-off-by: Patrick Venture <venture@google.com>
Change-Id: I96f3335a1341bc29eeff398f200214f240861047
diff --git a/firmware_handler.cpp b/firmware_handler.cpp
index 675929c..6a317a7 100644
--- a/firmware_handler.cpp
+++ b/firmware_handler.cpp
@@ -441,16 +441,7 @@
lookup[session] = curr;
- /* This may be them re-opening a blob, so let's only push it onto the list
- * when appropriate.
- */
- auto blobIdMatch =
- std::find_if(blobIDs.begin(), blobIDs.end(),
- [active](const auto& iter) { return (iter == *active); });
- if (blobIdMatch == blobIDs.end())
- {
- blobIDs.push_back(*active);
- }
+ addBlobId(*active);
state = UpdateState::uploadInProgress;
fileOpen = true;