mirror of
https://github.com/jarun/nnn.git
synced 2025-01-25 18:26:59 +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;
|
off_t sz = 0;
|
||||||
int len = scanselforpath(path, FALSE);
|
int len = scanselforpath(path, FALSE);
|
||||||
|
|
||||||
for (int r = 0; r < ndents; ++r)
|
for (int r = 0, selcount = nselected; (r < ndents) && selcount; ++r)
|
||||||
if (findinsel(findselpos,
|
if (findinsel(findselpos, len + xstrsncpy(g_sel + len, pdents[r].name, pdents[r].nlen))) {
|
||||||
len + xstrsncpy(g_sel + len, pdents[r].name, pdents[r].nlen)))
|
|
||||||
sz += cfg.blkorder ? pdents[r].blocks : pdents[r].size;
|
sz += cfg.blkorder ? pdents[r].blocks : pdents[r].size;
|
||||||
|
--selcount;
|
||||||
|
}
|
||||||
|
|
||||||
printmsg(coolsize(cfg.blkorder ? sz << blk_shift : sz));
|
printmsg(coolsize(cfg.blkorder ? sz << blk_shift : sz));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue