From 56165305a4b5d9432566fd62914191c74f51df9c Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 22 Dec 2011 21:11:38 +0000 Subject: [PATCH] Change the check for duplicate keys when writing the options file to an assertion as it can't actually happen Originally committed to SVN as r6013. --- aegisub/libaegisub/common/option.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/aegisub/libaegisub/common/option.cpp b/aegisub/libaegisub/common/option.cpp index 94765e167..99741c3ea 100644 --- a/aegisub/libaegisub/common/option.cpp +++ b/aegisub/libaegisub/common/option.cpp @@ -207,12 +207,7 @@ void Options::Flush() { bool Options::PutOption(json::Object &obj, const std::string &path, const json::UnknownElement &value) { // Having a '/' denotes it is a leaf. if (path.find('/') == std::string::npos) { - json::Object::iterator pos = obj.find(path); - - // Fail if a key of the same name already exists. - if (pos != obj.end()) - throw OptionErrorDuplicateKey("Key already exists"); - + assert(obj.find(path) == obj.end()); obj[path] = value; return true; } else {