mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-12 17:08:39 -09:00
Slightly improve hardlink circular list insertion performance
Based on https://dev.yorhel.nl/ncdu/bug/124
This commit is contained in:
parent
d95c65b032
commit
bf8068b65e
1 changed files with 2 additions and 4 deletions
|
|
@ -67,10 +67,8 @@ static void hlink_check(struct dir *d) {
|
|||
|
||||
/* found in the table? update hlnk */
|
||||
if(!i) {
|
||||
t = d->hlnk = kh_key(links, k);
|
||||
if(t->hlnk != NULL)
|
||||
for(t=t->hlnk; t->hlnk!=d->hlnk; t=t->hlnk)
|
||||
;
|
||||
t = kh_key(links, k);
|
||||
d->hlnk = t->hlnk == NULL ? t : t->hlnk;
|
||||
t->hlnk = d;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue