mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-28 15:34:31 +00:00
refactor(kernel): replace manual sorting with std::sort
This commit is contained in:
parent
3d87345a51
commit
764dfe67a5
@ -131,24 +131,8 @@ namespace SymbolResolver
|
|||||||
|
|
||||||
if (Symbols != nullptr && StringAddress != nullptr)
|
if (Symbols != nullptr && StringAddress != nullptr)
|
||||||
{
|
{
|
||||||
size_t Index, MinimumIndex;
|
std::sort(Symbols, Symbols + TotalEntries, [](const Elf_Sym &a, const Elf_Sym &b)
|
||||||
for (size_t i = 0; i < TotalEntries - 1; i++)
|
{ return a.st_value < b.st_value; });
|
||||||
{
|
|
||||||
MinimumIndex = i;
|
|
||||||
for (Index = i + 1; Index < TotalEntries; Index++)
|
|
||||||
{
|
|
||||||
bool condition = Symbols[Index].st_value < Symbols[MinimumIndex].st_value;
|
|
||||||
if (condition)
|
|
||||||
MinimumIndex = Index;
|
|
||||||
}
|
|
||||||
|
|
||||||
Elf_Sym tmp = Symbols[MinimumIndex];
|
|
||||||
Symbols[MinimumIndex] = Symbols[i];
|
|
||||||
Symbols[i] = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
// std::sort(Symbols, Symbols + TotalEntries, [](const Elf_Sym &a, const Elf_Sym &b)
|
|
||||||
// { return a.st_value < b.st_value; });
|
|
||||||
|
|
||||||
while (Symbols[0].st_value == 0)
|
while (Symbols[0].st_value == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user