mirror of https://github.com/Icinga/icinga2.git
Dictionary#Remove(): remove unused bool overrideFrozen
This commit is contained in:
parent
24b57f0d3a
commit
270c6392d4
|
@ -141,13 +141,12 @@ Dictionary::Iterator Dictionary::End()
|
||||||
* Removes the item specified by the iterator from the dictionary.
|
* Removes the item specified by the iterator from the dictionary.
|
||||||
*
|
*
|
||||||
* @param it The iterator.
|
* @param it The iterator.
|
||||||
* @param overrideFrozen Whether to allow modifying frozen dictionaries.
|
|
||||||
*/
|
*/
|
||||||
void Dictionary::Remove(Dictionary::Iterator it, bool overrideFrozen)
|
void Dictionary::Remove(Dictionary::Iterator it)
|
||||||
{
|
{
|
||||||
ASSERT(OwnsLock());
|
ASSERT(OwnsLock());
|
||||||
|
|
||||||
if (m_Frozen && !overrideFrozen)
|
if (m_Frozen)
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Dictionary must not be modified."));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Dictionary must not be modified."));
|
||||||
|
|
||||||
m_Data.erase(it);
|
m_Data.erase(it);
|
||||||
|
@ -157,13 +156,12 @@ void Dictionary::Remove(Dictionary::Iterator it, bool overrideFrozen)
|
||||||
* Removes the specified key from the dictionary.
|
* Removes the specified key from the dictionary.
|
||||||
*
|
*
|
||||||
* @param key The key.
|
* @param key The key.
|
||||||
* @param overrideFrozen Whether to allow modifying frozen dictionaries.
|
|
||||||
*/
|
*/
|
||||||
void Dictionary::Remove(const String& key, bool overrideFrozen)
|
void Dictionary::Remove(const String& key)
|
||||||
{
|
{
|
||||||
ObjectLock olock(this);
|
ObjectLock olock(this);
|
||||||
|
|
||||||
if (m_Frozen && !overrideFrozen)
|
if (m_Frozen)
|
||||||
BOOST_THROW_EXCEPTION(std::invalid_argument("Dictionary must not be modified."));
|
BOOST_THROW_EXCEPTION(std::invalid_argument("Dictionary must not be modified."));
|
||||||
|
|
||||||
Dictionary::Iterator it;
|
Dictionary::Iterator it;
|
||||||
|
|
|
@ -49,9 +49,9 @@ public:
|
||||||
|
|
||||||
size_t GetLength() const;
|
size_t GetLength() const;
|
||||||
|
|
||||||
void Remove(const String& key, bool overrideFrozen = false);
|
void Remove(const String& key);
|
||||||
|
|
||||||
void Remove(Iterator it, bool overrideFrozen = false);
|
void Remove(Iterator it);
|
||||||
|
|
||||||
void Clear(bool overrideFrozen = false);
|
void Clear(bool overrideFrozen = false);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue