diff options
author | 2021-07-14 12:53:01 -0700 | |
---|---|---|
committer | 2021-07-15 13:42:13 -0700 | |
commit | 4382e44c42d2a1edf92a9ef11dbf34843025e64f (patch) | |
tree | f4b2855b1df909e526a298300ee55f79a65ccc79 /tools/aapt2/ResourceValues.cpp | |
parent | 3947c9b56c2e79d76b6941fb5bdcdf25e359b0a4 (diff) |
Replace Maybe with std::optional
With c++17, std::optional provides the functionality that Maybe
provided.
Bug: 183215655
Test: aapt2_tests
Change-Id: I62bb9c2fa4985dc5217a6ed153df92b85ad9a034
Diffstat (limited to 'tools/aapt2/ResourceValues.cpp')
-rw-r--r-- | tools/aapt2/ResourceValues.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |