OSDN Git Service

ART: Change iterator value type to match
authorAndreas Gampe <agampe@google.com>
Thu, 3 Nov 2016 15:19:01 +0000 (08:19 -0700)
committerAndreas Gampe <agampe@google.com>
Thu, 3 Nov 2016 18:16:36 +0000 (11:16 -0700)
Make keys const.

Bug: 32619234
Test: m
Change-Id: I240341a0fec79754bea2ed21c0d0a4ddd119ce35

runtime/hprof/hprof.cc
runtime/verifier/register_line.cc

index 2336759..8cbe491 100644 (file)
@@ -574,9 +574,9 @@ class Hprof : public SingleRootVisitor {
   }
 
   void WriteStringTable() {
-    for (const std::pair<std::string, HprofStringId>& p : strings_) {
+    for (const auto& p : strings_) {
       const std::string& string = p.first;
-      const size_t id = p.second;
+      const HprofStringId id = p.second;
 
       output_->StartNewRecord(HPROF_TAG_STRING, kHprofTime);
 
index 4ec2da6..da3d946 100644 (file)
@@ -411,7 +411,7 @@ bool FindLockAliasedRegister(uint32_t src,
   }
 
   // Scan the map for the same value.
-  for (const std::pair<uint32_t, uint32_t>& pair : search_map) {
+  for (const std::pair<const uint32_t, uint32_t>& pair : search_map) {
     if (pair.first != src && pair.second == src_lock_levels) {
       return true;
     }