Commit 5345cae8 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

* src/tgbaalgos/emptiness_stats.hh: Modernize.

parent d9d46492
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6), // -*- coding: utf-8 -*-
// département Systèmes Répartis Coopératifs (SRC), Université Pierre // Copyright (C) 2015 Laboratoire de Recherche et Développement de
// et Marie Curie. // l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6
// (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
// Pierre et Marie Curie.
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
// //
...@@ -40,7 +43,7 @@ namespace spot ...@@ -40,7 +43,7 @@ namespace spot
unsigned unsigned
get(const char* str) const get(const char* str) const
{ {
stats_map::const_iterator i = stats.find(str); auto i = stats.find(str);
assert(i != stats.end()); assert(i != stats.end());
return (this->*i->second)(); return (this->*i->second)();
} }
...@@ -74,9 +77,8 @@ namespace spot ...@@ -74,9 +77,8 @@ namespace spot
{ {
if (!set) if (!set)
{ {
unsigned_statistics::stats_map::const_iterator i; for (auto& i: o.stats)
for (i = o.stats.begin(); i != o.stats.end(); ++i) stats[i.first] = (o.*i.second)();
stats[i->first] = (o.*i->second)();
set = true; set = true;
return true; return true;
} }
...@@ -92,13 +94,12 @@ namespace spot ...@@ -92,13 +94,12 @@ namespace spot
bool bool
operator==(const unsigned_statistics_copy& o) const operator==(const unsigned_statistics_copy& o) const
{ {
stats_map::const_iterator i; for (auto& i: stats)
for (i = stats.begin(); i != stats.end(); ++i)
{ {
stats_map::const_iterator i2 = o.stats.find(i->first); auto i2 = o.stats.find(i.first);
if (i2 == o.stats.end()) if (i2 == o.stats.end())
return false; return false;
if (i->second != i2->second) if (i.second != i2->second)
return false; return false;
} }
return true; return true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment