diff --git a/lib/base/dictionary.cpp b/lib/base/dictionary.cpp index e939cadeb..9429af304 100644 --- a/lib/base/dictionary.cpp +++ b/lib/base/dictionary.cpp @@ -142,14 +142,13 @@ Dictionary::Iterator Dictionary::End() * Removes the item specified by the iterator from the dictionary. * * @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()); std::unique_lock lock (m_DataMutex); - if (m_Frozen && !overrideFrozen) + if (m_Frozen) BOOST_THROW_EXCEPTION(std::invalid_argument("Dictionary must not be modified.")); m_Data.erase(it); @@ -159,14 +158,13 @@ void Dictionary::Remove(Dictionary::Iterator it, bool overrideFrozen) * Removes the specified key from the dictionary. * * @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); std::unique_lock lock (m_DataMutex); - if (m_Frozen && !overrideFrozen) + if (m_Frozen) BOOST_THROW_EXCEPTION(std::invalid_argument("Dictionary must not be modified.")); Dictionary::Iterator it; @@ -180,15 +178,13 @@ void Dictionary::Remove(const String& key, bool overrideFrozen) /** * Removes all dictionary items. - * - * @param overrideFrozen Whether to allow modifying frozen dictionaries. */ -void Dictionary::Clear(bool overrideFrozen) +void Dictionary::Clear() { ObjectLock olock(this); std::unique_lock lock (m_DataMutex); - if (m_Frozen && !overrideFrozen) + if (m_Frozen) BOOST_THROW_EXCEPTION(std::invalid_argument("Dictionary must not be modified.")); m_Data.clear(); diff --git a/lib/base/dictionary.hpp b/lib/base/dictionary.hpp index e1abf826c..352c29ef9 100644 --- a/lib/base/dictionary.hpp +++ b/lib/base/dictionary.hpp @@ -50,11 +50,11 @@ public: 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(); void CopyTo(const Dictionary::Ptr& dest) const; Dictionary::Ptr ShallowClone() const; diff --git a/lib/base/scriptglobal.cpp b/lib/base/scriptglobal.cpp index 9c12158a9..e85e9ecb5 100644 --- a/lib/base/scriptglobal.cpp +++ b/lib/base/scriptglobal.cpp @@ -32,7 +32,7 @@ Value ScriptGlobal::Get(const String& name, const Value *defaultValue) return result; } -void ScriptGlobal::Set(const String& name, const Value& value, bool overrideFrozen) +void ScriptGlobal::Set(const String& name, const Value& value) { std::vector tokens = name.Split("."); @@ -60,7 +60,7 @@ void ScriptGlobal::Set(const String& name, const Value& value, bool overrideFroz } } - parent->SetFieldByName(tokens[tokens.size() - 1], value, overrideFrozen, DebugInfo()); + parent->Set(tokens[tokens.size() - 1], value); } } diff --git a/lib/base/scriptglobal.hpp b/lib/base/scriptglobal.hpp index c31cdcdf6..f349b7b01 100644 --- a/lib/base/scriptglobal.hpp +++ b/lib/base/scriptglobal.hpp @@ -18,7 +18,7 @@ class ScriptGlobal { public: static Value Get(const String& name, const Value *defaultValue = nullptr); - static void Set(const String& name, const Value& value, bool overrideFrozen = false); + static void Set(const String& name, const Value& value); static void SetConst(const String& name, const Value& value); static bool Exists(const String& name);