improvement: Don't deserialize again if past attempt failed
Store the state of deserialization such that we only
attemp once when no persisted blobs were found.
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: I1d7f605eeff724849429d2ee8fb28b0aa4c05381
diff --git a/binarystore.hpp b/binarystore.hpp
index f07cf7b..3a25581 100644
--- a/binarystore.hpp
+++ b/binarystore.hpp
@@ -142,9 +142,10 @@
private:
enum class CommitState
{
- Dirty, // In-memory data might not match persisted data
- Clean, // In-memory data matches persisted data
- CommitError // Error happened during committing
+ Dirty, // In-memory data might not match persisted data
+ Clean, // In-memory data matches persisted data
+ Uninitialized, // Cannot find persisted data
+ CommitError // Error happened during committing
};
/* Load the serialized data from sysfile if commit state is dirty.