Commit 0c9cdb3
committed
Optimize diff-hl--update
This adds two optimizations during the buffer traversal.
First, (eq buf base) is checked before calling (buffer-base-buffer buf).
This short-circuits evaluation to bypass the buffer-base-buffer call
overhead.
Second, the boolean state of (or changes ref-changes) outside the loop.
This prevents the Lisp interpreter from recalculating the same static
condition for all active buffers.1 parent 81b7628 commit 0c9cdb3
1 file changed
Lines changed: 14 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
745 | | - | |
| 745 | + | |
| 746 | + | |
746 | 747 | | |
747 | | - | |
748 | | - | |
| 748 | + | |
749 | 749 | | |
750 | 750 | | |
| 751 | + | |
751 | 752 | | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
761 | 763 | | |
762 | 764 | | |
763 | 765 | | |
| |||
0 commit comments