From 2dec97464cb14b484fdf1185c6795336ebb90ee7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 13 Aug 2026 07:47:47 +0800 Subject: [PATCH] vim-patch:9.2.0954: u_read_undo() can be improved (after 9.2.0935) Problem: u_read_undo() has comments that do not add anything to what the code says (afte rv9.2.0935). Solution: Drop the redundant comments (Hirohito Higashi). related: vim/vim#20942 closes: vim/vim#21028 https://github.com/vim/vim/commit/ecfea491aa964311a42f888277da7911c9d6900d Co-authored-by: Hirohito Higashi Co-Authored-By: Claude Opus 5 (1M context) --- src/nvim/undo.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 8c664b74eb..5c7c2a0364 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -1366,8 +1366,7 @@ theend: } } -/// Compare undo headers on the sequence number, for sorting uhp_table in -/// u_read_undo(). +/// Compare undo headers on the sequence number, for sorting uhp_table. static int uhp_seq_cmp(const void *v1, const void *v2) { const u_header_T *u1 = *(u_header_T **)v1; @@ -1584,9 +1583,7 @@ void u_read_undo(char *name, const uint8_t *hash, const char *orig_name FUNC_ATT // We have put all of the headers into a table. Each header stores the // sequence numbers of the headers it links to; resolve those into - // pointers. Sort the table on uh_seq once, so that every lookup is a - // binary search instead of a linear scan, which would be quadratic - // overall. Every entry is non-NULL: a header that failed to + // pointers. Every entry is non-NULL: a header that failed to // unserialize or a count mismatch was an error above. if (num_head > 0) { qsort(uhp_table, (size_t)num_head, sizeof(u_header_T *), uhp_seq_cmp);