Avoid unnecessary copying while iterating the class table
Missing `&` would imply we are copying the slots in the loop.
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Bug: 175869411
Change-Id: Idbb84500080b227ae4384e9e878c143d7209e514
diff --git a/dex2oat/linker/image_writer.cc b/dex2oat/linker/image_writer.cc
index 6e7f52e..0a6566c 100644
--- a/dex2oat/linker/image_writer.cc
+++ b/dex2oat/linker/image_writer.cc
@@ -3044,7 +3044,7 @@
for (ImageInfo& image_info : image_infos_) {
if (image_info.class_table_size_ != 0u) {
DCHECK(image_info.class_table_.has_value());
- for (const ClassTable::TableSlot slot : *image_info.class_table_) {
+ for (const ClassTable::TableSlot& slot : *image_info.class_table_) {
ObjPtr<mirror::Class> klass = slot.Read<kWithoutReadBarrier>();
DCHECK(klass != nullptr);
// Do not process boot image classes present in app image class table.