- 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:
parent
696c513ed2
commit
231662825d
8 changed files with 55 additions and 185 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue