X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fdebug%2Fprofiler.cpp;fp=source%2Fdebug%2Fprofiler.cpp;h=c82558b01f6e119720e7d119d5c2cf6d2ef36a65;hp=c4c880b70241c826d87e7db7ba3598bc8034be84;hb=f24e7b96e76b63c9b9b8a6bce4c7a9db64276ea8;hpb=9f754b788b872f9768af8c3a4f9e001a588e011a diff --git a/source/debug/profiler.cpp b/source/debug/profiler.cpp index c4c880b..c82558b 100644 --- a/source/debug/profiler.cpp +++ b/source/debug/profiler.cpp @@ -18,9 +18,9 @@ void Profiler::set_period(unsigned p) return; period = p; - for(map::iterator i=scopes.begin(); i!=scopes.end(); ++i) + for(auto &kvp: scopes) { - ScopeInfo &si = i->second; + ScopeInfo &si = kvp.second; if(p==0) si.history.clear(); else @@ -34,7 +34,7 @@ void Profiler::add_scope(const string &name) { if(!scopes.count(name)) { - map::iterator i = scopes.insert(map::value_type(name, ScopeInfo())).first; + auto i = scopes.insert(make_pair(name, ScopeInfo())).first; i->second.history.resize(period); } } @@ -48,10 +48,10 @@ ProfilingScope *Profiler::enter(ProfilingScope *ps) void Profiler::record(const ProfilingScope &scope) { - map::iterator i = scopes.find(scope.get_name()); + auto i = scopes.find(scope.get_name()); if(i==scopes.end()) { - i = scopes.insert(map::value_type(scope.get_name(), ScopeInfo())).first; + i = scopes.insert(make_pair(scope.get_name(), ScopeInfo())).first; i->second.first_call = scope.get_entry_time(); i->second.history.resize(period); }