summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index b74e81f14e..6e12eba794 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1757,10 +1757,10 @@ bool ClassLinker::OpenImageDexFiles(gc::space::ImageSpace* space,
const ImageHeader& header = space->GetImageHeader();
ObjPtr<mirror::Object> dex_caches_object = header.GetImageRoot(ImageHeader::kDexCaches);
DCHECK(dex_caches_object != nullptr);
- mirror::ObjectArray<mirror::DexCache>* dex_caches =
+ ObjPtr<mirror::ObjectArray<mirror::DexCache>> dex_caches =
dex_caches_object->AsObjectArray<mirror::DexCache>();
const OatFile* oat_file = space->GetOatFile();
- for (int32_t i = 0; i < dex_caches->GetLength(); i++) {
+ for (int32_t i = 0, length = dex_caches->GetLength(); i != length; ++i) {
ObjPtr<mirror::DexCache> dex_cache = dex_caches->Get(i);
std::string dex_file_location(dex_cache->GetLocation()->ToModifiedUtf8());
std::unique_ptr<const DexFile> dex_file = OpenOatDexFile(oat_file,