parent
931ee84685
commit
e0e3f396f2
@ -108,30 +108,24 @@ std::vector<std::pair<AString, AString>> cOverridesSettingsRepository::GetValues
|
||||
{
|
||||
auto overrides = m_Overrides->GetValues(a_keyName);
|
||||
auto main = m_Main->GetValues(a_keyName);
|
||||
std::sort(overrides.begin(), overrides.end(), [](std::pair<AString, AString> a, std::pair<AString, AString> b) -> bool { return a < b ;});
|
||||
std::sort(main.begin(), main.end(), [](std::pair<AString, AString> a, std::pair<AString, AString> b) -> bool { return a < b ;});
|
||||
|
||||
std::vector<std::pair<AString, AString>> ret;
|
||||
auto ret = overrides;
|
||||
|
||||
|
||||
size_t overridesIndex = 0;
|
||||
for (auto pair : main)
|
||||
for (auto mainpair : main)
|
||||
{
|
||||
if (overridesIndex >= overrides.size())
|
||||
bool found = false;
|
||||
for (const auto & overridepair : overrides)
|
||||
{
|
||||
ret.push_back(pair);
|
||||
continue;
|
||||
if (overridepair.first == mainpair.first)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
if (pair.first == overrides[overridesIndex].first)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
while (pair.first > overrides[overridesIndex].first)
|
||||
if (found == false)
|
||||
{
|
||||
ret.push_back(overrides[overridesIndex]);
|
||||
overridesIndex++;
|
||||
ret.push_back(mainpair);
|
||||
}
|
||||
ret.push_back(pair);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user