Move error when returning

This commit is contained in:
Jeremy 2024-03-31 15:52:45 -05:00
parent 124607e7bf
commit dc9cee98fb
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4

View File

@ -36,7 +36,7 @@ namespace detail {
auto base = elf_get_module_image_base(object_path);
// TODO: Cache the error
if(base.is_error()) {
return base.unwrap_error();
return std::move(base).unwrap_error();
}
cache.insert(it, {object_path, base.unwrap_value()});
return base;
@ -63,7 +63,7 @@ namespace detail {
}
auto base = obj.unwrap_value().get_text_vmaddr();
if(!base) {
return base.unwrap_error();
return std::move(base).unwrap_error();
}
cache.insert(it, {object_path, base.unwrap_value()});
return base;
@ -83,7 +83,7 @@ namespace detail {
auto base = pe_get_module_image_base(object_path);
// TODO: Cache the error
if(!base) {
return base.unwrap_error();
return std::move(base).unwrap_error();
}
cache.insert(it, {object_path, base.unwrap_value()});
return base;