binarystore: Cleanup optional config with default values.

Change-Id: If76d85f7aafbec30756dd01d871a78389d6e87a8
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/src/main.cpp b/src/main.cpp
index bb45f55..8e3d244 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -65,9 +65,8 @@
             "Loading from config with",
             entry("BASE_ID=%s", config.blobBaseId.c_str()),
             entry("FILE=%s", config.sysFilePath.c_str()),
-            entry("MAX_SIZE=%llx",
-                  static_cast<unsigned long long>(
-                      config.maxSizeBytes ? *config.maxSizeBytes : 0)));
+            entry("MAX_SIZE=%llx", static_cast<unsigned long long>(
+                                       config.maxSizeBytes.value_or(0))));
 
         auto file = std::make_unique<binstore::SysFileImpl>(config.sysFilePath,
                                                             config.offsetBytes);
diff --git a/src/sys_file_impl.cpp b/src/sys_file_impl.cpp
index 9fab76a..7aadfba 100644
--- a/src/sys_file_impl.cpp
+++ b/src/sys_file_impl.cpp
@@ -25,7 +25,7 @@
     sys(sys)
 {
     fd_ = sys->open(path.c_str(), O_RDWR);
-    offset_ = offset ? *offset : 0;
+    offset_ = offset.value_or(0);
 
     if (fd_ < 0)
     {