Commit 9db9eec
attr: avoid calling find_basename() twice per path
find_basename() is only used inside collect_all_attrs(), called once
in prepare_attr_stack, then again after prepare_attr_stack()
returns. Both calls return exact same value. Reorder the code to do
the same task once. Also avoid strlen() because we knows the length
after finding basename.
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 711536b commit 9db9eec
1 file changed
+18
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
| 567 | + | |
579 | 568 | | |
580 | 569 | | |
581 | | - | |
| 570 | + | |
582 | 571 | | |
583 | 572 | | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | 573 | | |
594 | 574 | | |
595 | 575 | | |
| |||
769 | 749 | | |
770 | 750 | | |
771 | 751 | | |
772 | | - | |
773 | | - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
774 | 767 | | |
775 | | - | |
| 768 | + | |
776 | 769 | | |
777 | 770 | | |
778 | 771 | | |
779 | | - | |
780 | | - | |
781 | 772 | | |
782 | 773 | | |
783 | 774 | | |
| |||
0 commit comments