Optimize listed selection size calculation

This commit is contained in:
Arun Prakash Jana 2023-01-31 18:36:26 +05:30
parent d0631707fc
commit 58b77411c8
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 4 additions and 3 deletions

View File

@ -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));
}