refactor
This commit is contained in:
@@ -322,11 +322,12 @@ auto sia_provider::get_directory_items(const std::string &api_path,
|
||||
return api_error::error;
|
||||
}
|
||||
|
||||
std::sort(list.begin(), list.end(), [](const auto &a, const auto &b) -> bool {
|
||||
return (a.directory && not b.directory) ||
|
||||
(not(b.directory && not a.directory) &&
|
||||
(a.api_path.compare(b.api_path) < 0));
|
||||
});
|
||||
std::sort(list.begin(), list.end(),
|
||||
[](const auto &item1, const auto &item2) -> bool {
|
||||
return (item1.directory && not item2.directory) ||
|
||||
(not(item2.directory && not item1.directory) &&
|
||||
(item1.api_path.compare(item2.api_path) < 0));
|
||||
});
|
||||
|
||||
list.insert(list.begin(), directory_item{
|
||||
"..",
|
||||
|
Reference in New Issue
Block a user