LocationConfig sorter works as intended, tho should prolly check things thoroughly later

This commit is contained in:
Eric LAZO
2022-08-04 19:33:38 +02:00
parent fce1bcbece
commit f7e6b61811
2 changed files with 16 additions and 86 deletions

View File

@@ -139,8 +139,6 @@ void ConfigParser::_post_processing(std::vector<ServerConfig> *servers)
++it_l;
}
// Then put locations in order...
// may change how the order is set later
// ok we can sort in order and reverse...
@@ -148,38 +146,10 @@ void ConfigParser::_post_processing(std::vector<ServerConfig> *servers)
// std::sort(it->locations.begin(), it->locations.end(), compareLocationConfigs);
std::sort(it->locations.begin(), it->locations.end());
// for some reason no need to reverse...
// std::reverse(it->locations.begin(), it->locations.end());
std::reverse(it->locations.begin(), it->locations.end());
/*
// let's test sort
int myints[] = {32,71,12,45,26,80,53,33};
// std::vector<spec_int> myvector (myints, myints+8);
// std::vector<spec_int> myvector(10, 5);
std::vector<spec_int> myvector;
myvector.resize(6);
myvector[0].i = 32;
myvector[1].i = 71;
myvector[2].i = 12;
myvector[3].i = 45;
myvector[4].i = 26;
myvector[5].i = 80;
std::sort(myvector.begin(), myvector.end());
std::cout << "myvector contains:";
// for (std::vector<int>::iterator it=myvector.begin(); it!=myvector.end(); ++it)
for (std::vector<spec_int>::iterator it=myvector.begin(); it!=myvector.end(); ++it)
std::cout << ' ' << *it;
std::cout << '\n';
*/
++it;
}