mirror of
https://github.com/electronicarts/CNC_TS_and_RA2_Mission_Editor.git
synced 2025-05-10 13:41:40 -04:00
#51, fixed ASSERT raised missing code procedure issue.
This commit is contained in:
parent
7cf299d58e
commit
12d4e2705c
1 changed files with 6 additions and 4 deletions
|
@ -199,7 +199,8 @@ public:
|
|||
ASSERT(idx < value_pairs.size());
|
||||
// delete from record first;
|
||||
auto const& pair = value_pairs.at(idx);
|
||||
ASSERT(value_pos.erase(pair.first) == 1);
|
||||
auto const eraseCount = value_pos.erase(pair.first);
|
||||
ASSERT(eraseCount == 1);
|
||||
value_pairs.erase(value_pairs.begin() + idx);
|
||||
// now update all key-pos indexing, dec 1
|
||||
for (auto affectedIdx = idx; affectedIdx < value_pairs.size(); ++affectedIdx) {
|
||||
|
@ -348,12 +349,13 @@ public:
|
|||
void SetString(const CString& section, const CString& key, CString&& value) {
|
||||
auto const it = sections.find(section);
|
||||
if (it != sections.end()) {
|
||||
it->second.SetString(key, value);
|
||||
it->second.SetString(key, std::move(value));
|
||||
return;
|
||||
}
|
||||
auto&& newSec = CIniFileSection{};
|
||||
newSec.SetString(key, value);
|
||||
ASSERT(sections.insert({ section, std::move(newSec) }).second == true);
|
||||
newSec.SetString(key, std::move(value));
|
||||
auto const success = sections.insert({ section, std::move(newSec) }).second;
|
||||
ASSERT(success == true);
|
||||
}
|
||||
|
||||
void SetString(const CString& section, const CString& key, const CString& value) {
|
||||
|
|
Loading…
Add table
Reference in a new issue