mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Feature #1288: Code cleanup
This commit is contained in:
parent
06581af467
commit
73baa84fbd
@ -147,18 +147,6 @@ protected:
|
||||
VectorAttribute **va,
|
||||
map<string, Attribute *>::iterator& it);
|
||||
|
||||
/**
|
||||
* Deletes a quota from the index. The quota pointer is freed.
|
||||
* @param it The quota iterator, as returned by Quota::get_quota
|
||||
*/
|
||||
virtual void del(map<string, Attribute *>::iterator& it)
|
||||
{
|
||||
Attribute * attr = it->second;
|
||||
delete attr;
|
||||
|
||||
attributes.erase(it);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a quota has 0 limit and usage, and deletes it
|
||||
*
|
||||
|
@ -343,7 +343,9 @@ void Quota::cleanup_quota(const string& qid)
|
||||
|
||||
if ( limit == 0 && usage == 0 )
|
||||
{
|
||||
del(q_it);
|
||||
delete static_cast<Attribute *>(q_it->second);
|
||||
|
||||
attributes.erase(q_it);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user