ART: Add operator == and != with nullptr to Handle
Get it in line with ObjPtr and prettify our code.
Test: m
Change-Id: I1322e2a9bc7a85d7f2441034a19bf4d807b81a0e
diff --git a/runtime/art_method.cc b/runtime/art_method.cc
index 4902ad4..6b52959 100644
--- a/runtime/art_method.cc
+++ b/runtime/art_method.cc
@@ -274,7 +274,7 @@
*has_no_move_exception = (first_catch_instr->Opcode() != Instruction::MOVE_EXCEPTION);
}
// Put the exception back.
- if (exception.Get() != nullptr) {
+ if (exception != nullptr) {
self->SetException(exception.Get());
}
return found_dex_pc;
@@ -489,7 +489,7 @@
const auto& proto_id = dex_file->GetMethodPrototype(method_id);
const DexFile::TypeList* proto_params = dex_file->GetProtoParameters(proto_id);
auto count = proto_params != nullptr ? proto_params->Size() : 0u;
- auto param_len = params.Get() != nullptr ? params->GetLength() : 0u;
+ auto param_len = params != nullptr ? params->GetLength() : 0u;
if (param_len != count) {
return false;
}