mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-12 17:08:39 -09:00
Use slower and smaller heap sort for hardlink list
Saves 20 KiB off of the ReleaseSafe + stripped binary. That feature is (1) rarely used and (2) rarely deals with large lists, so no point spending that much space on an efficient sort implementation.
This commit is contained in:
parent
f28f69d831
commit
9cbe1bc91f
1 changed files with 1 additions and 4 deletions
|
|
@ -380,10 +380,7 @@ const info = struct {
|
|||
if (&l.entry == e)
|
||||
break;
|
||||
}
|
||||
// TODO: Zig's sort() implementation is type-generic and not very
|
||||
// small. I suspect we can get a good save on our binary size by using
|
||||
// a smaller or non-generic sort. This doesn't have to be very fast.
|
||||
std.mem.sort(*model.Link, list.items, {}, lt);
|
||||
std.sort.heap(*model.Link, list.items, {}, lt);
|
||||
for (list.items, 0..) |n,i| if (&n.entry == e) { links_idx = i; };
|
||||
links = list;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue