From 4382e44c42d2a1edf92a9ef11dbf34843025e64f Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Wed, 14 Jul 2021 12:53:01 -0700 Subject: Replace Maybe with std::optional With c++17, std::optional provides the functionality that Maybe provided. Bug: 183215655 Test: aapt2_tests Change-Id: I62bb9c2fa4985dc5217a6ed153df92b85ad9a034 --- tools/aapt2/ResourceValues.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools/aapt2/ResourceValues.cpp') diff --git a/tools/aapt2/ResourceValues.cpp b/tools/aapt2/ResourceValues.cpp index 2a90f267f185..b3ab4ffc649b 100644 --- a/tools/aapt2/ResourceValues.cpp +++ b/tools/aapt2/ResourceValues.cpp @@ -120,7 +120,7 @@ bool Reference::Flatten(android::Res_value* out_value) const { return false; } - const ResourceId resid = id.value_or_default(ResourceId(0)); + const ResourceId resid = id.value_or(ResourceId(0)); const bool dynamic = resid.is_valid() && is_dynamic; if (reference_type == Reference::Type::kResource) { @@ -1040,7 +1040,7 @@ void Macro::Print(std::ostream* out) const { } bool operator<(const Reference& a, const Reference& b) { - int cmp = a.name.value_or_default({}).compare(b.name.value_or_default({})); + int cmp = a.name.value_or(ResourceName{}).compare(b.name.value_or(ResourceName{})); if (cmp != 0) return cmp < 0; return a.id < b.id; } -- cgit v1.2.3-59-g8ed1b