mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
Optimize listed selection size calculation
This commit is contained in:
parent
d0631707fc
commit
58b77411c8
|
@ -6639,10 +6639,11 @@ static void showselsize(const char *path)
|
|||
off_t sz = 0;
|
||||
int len = scanselforpath(path, FALSE);
|
||||
|
||||
for (int r = 0; r < ndents; ++r)
|
||||
if (findinsel(findselpos,
|
||||
len + xstrsncpy(g_sel + len, pdents[r].name, pdents[r].nlen)))
|
||||
for (int r = 0, selcount = nselected; (r < ndents) && selcount; ++r)
|
||||
if (findinsel(findselpos, len + xstrsncpy(g_sel + len, pdents[r].name, pdents[r].nlen))) {
|
||||
sz += cfg.blkorder ? pdents[r].blocks : pdents[r].size;
|
||||
--selcount;
|
||||
}
|
||||
|
||||
printmsg(coolsize(cfg.blkorder ? sz << blk_shift : sz));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue