mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -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 */
|
/* found in the table? update hlnk */
|
||||||
if(!i) {
|
if(!i) {
|
||||||
t = d->hlnk = kh_key(links, k);
|
t = kh_key(links, k);
|
||||||
if(t->hlnk != NULL)
|
d->hlnk = t->hlnk == NULL ? t : t->hlnk;
|
||||||
for(t=t->hlnk; t->hlnk!=d->hlnk; t=t->hlnk)
|
|
||||||
;
|
|
||||||
t->hlnk = d;
|
t->hlnk = d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue