summaryrefslogtreecommitdiff
path: root/cmds/idmap2
diff options
context:
space:
mode:
authorBernie Innocenti <codewiz@google.com>2020-12-19 15:31:52 +0900
committerBernie Innocenti <codewiz@google.com>2020-12-21 15:50:57 +0000
commit58cf8e3ffa23752f4e8e38cab4d89f9b44f9e57a (patch)
tree3cc4048865054e95a9bf72a5a50fe19c8e849c29 /cmds/idmap2
parent96db3dad2a4a1c4f1622a2b268b347cda0e808db (diff)
Add explicit Result::ok() checks where needed
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests Exempt-From-Owner-Approval: mechanical mass refactoring Change-Id: I3117833c51cdb333cccdfd159d1582f2adef77db
Diffstat (limited to 'cmds/idmap2')
-rw-r--r--cmds/idmap2/idmap2/Lookup.cpp4
-rw-r--r--cmds/idmap2/libidmap2/XmlParser.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/cmds/idmap2/idmap2/Lookup.cpp b/cmds/idmap2/idmap2/Lookup.cpp
index 8323d0ba2415..437180d3d1be 100644
--- a/cmds/idmap2/idmap2/Lookup.cpp
+++ b/cmds/idmap2/idmap2/Lookup.cpp
@@ -71,7 +71,7 @@ Result<ResourceId> WARN_UNUSED ParseResReference(const AssetManager2& am, const
}
// next, try to parse as a package:type/name string
- if (auto resid = am.GetResourceId(res, "", fallback_package)) {
+ if (auto resid = am.GetResourceId(res, "", fallback_package); resid.ok()) {
return *resid;
}
@@ -94,7 +94,7 @@ void PrintValue(AssetManager2* const am, const AssetManager2::SelectedValue& val
case Res_value::TYPE_STRING: {
const ResStringPool* pool = am->GetStringPoolForCookie(value.cookie);
out->append("\"");
- if (auto str = pool->string8ObjectAt(value.data)) {
+ if (auto str = pool->string8ObjectAt(value.data); str.ok()) {
out->append(*str);
}
} break;
diff --git a/cmds/idmap2/libidmap2/XmlParser.cpp b/cmds/idmap2/libidmap2/XmlParser.cpp
index 7c55b64566f2..4030b83b3a41 100644
--- a/cmds/idmap2/libidmap2/XmlParser.cpp
+++ b/cmds/idmap2/libidmap2/XmlParser.cpp
@@ -98,7 +98,7 @@ Result<std::string> XmlParser::Node::GetAttributeStringValue(const std::string&
switch ((*value).dataType) {
case Res_value::TYPE_STRING: {
- if (auto str = parser_.getStrings().string8ObjectAt((*value).data)) {
+ if (auto str = parser_.getStrings().string8ObjectAt((*value).data); str.ok()) {
return std::string(str->string());
}
break;