- Unify interface of string_utils. I dropped most of the exception

handling, hoping it's unnecessary. Code should be slightly more
maintainable now.


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@943 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-08-26 10:45:04 +00:00
parent 696c513ed2
commit 231662825d
8 changed files with 55 additions and 185 deletions

View file

@ -144,20 +144,20 @@ CPUPoliciesGatekeeper::deactivate_policies(CPUPolicyManager* manager)
for (; avail_it != avail_end; ++avail_it)
{
// TODO isn't there a way to write more compact code by using
// library utilities?
ActiveIterator act_it = _active_policies.begin();
while (act_it != _active_policies.end())
{
if (act_it->second == *avail_it)
{
ActiveIterator removable = act_it++;
removable->second->deactivate();
_active_policies.erase(removable);
act_it->second->deactivate();
// Please note the postfix increment
// (operating on the old, now invalidated by
// erase, iterator object):
_active_policies.erase(act_it++);
}
else
act_it++;
++act_it;
}
} //~ for(avail_it)
}