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.
This commit is contained in:
Thomas Goyne 2011-12-22 21:11:38 +00:00
parent 4823706206
commit 56165305a4
1 changed files with 1 additions and 6 deletions

View File

@ -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 {