initialize end, clean up loop
authorNathan Binkert <binkertn@umich.edu>
Fri, 20 Oct 2006 06:35:59 +0000 (23:35 -0700)
committerNathan Binkert <binkertn@umich.edu>
Fri, 20 Oct 2006 06:35:59 +0000 (23:35 -0700)
--HG--
extra : convert_revision : e1c107f0c0fd5d535acd2d6c43571a5df57c9ed3

src/mem/page_table.cc

index fa6d5ddfb4579635462236f446f9ab8fd59a2f8c..fe8094b8884403e6a1c813e797fadd0e8b47d3fb 100644 (file)
@@ -170,11 +170,14 @@ PageTable::serialize(std::ostream &os)
 
     int count = 0;
 
-    m5::hash_map<Addr,Addr>::iterator iter;
-    m5::hash_map<Addr,Addr>::iterator end;
-    for (iter = pTable.begin(); iter != end; ++iter,++count) {
-        paramOut(os, csprintf("ptable.entry%dvaddr", count),iter->first);
-        paramOut(os, csprintf("ptable.entry%dpaddr", count),iter->second);
+    m5::hash_map<Addr,Addr>::iterator iter = pTable.begin();
+    m5::hash_map<Addr,Addr>::iterator end = pTable.end();
+    while (iter != end) {
+        paramOut(os, csprintf("ptable.entry%dvaddr", count), iter->first);
+        paramOut(os, csprintf("ptable.entry%dpaddr", count), iter->second);
+
+        ++iter;
+        ++count;
     }
     assert(count == pTable.size());
 }