[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sun, 12 Nov 2023 09:06:58 -0500 (EST) |
branch: master
commit 82f93eb9f0e3e93dd0d55cecb8886776d14a52be
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 12 15:01:13 2023 +0100
* tp/Texinfo/XS/main/get_perl_info.c
(get_sv_index_entries_sorted_by_letter): use
indices_info_index_by_name. Use entry_idx_in_index for index in
index_entries.
---
ChangeLog | 7 +++++++
tp/Texinfo/XS/main/get_perl_info.c | 16 +++++++---------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 01c2f7eb52..05f9baf710 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,13 @@
the column count of the word, rather than using uc_width. This way
we avoid calling it twice for every character.
+2023-11-12 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/get_perl_info.c
+ (get_sv_index_entries_sorted_by_letter): use
+ indices_info_index_by_name. Use entry_idx_in_index for index in
+ index_entries.
+
2023-11-12 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/convert_html.c
diff --git a/tp/Texinfo/XS/main/get_perl_info.c
b/tp/Texinfo/XS/main/get_perl_info.c
index fc76996dd2..fa6e22a4ca 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -575,7 +575,6 @@ get_sv_index_entries_sorted_by_letter (INDEX **index_names,
SV** index_name_sv;
SV** entry_number_sv;
INDEX *idx;
- INDEX **n;
char *entry_index_name;
int entry_number;
int entry_idx_in_index;
@@ -607,15 +606,14 @@ get_sv_index_entries_sorted_by_letter (INDEX
**index_names,
entry_number = SvIV (*entry_number_sv);
entry_idx_in_index = entry_number - 1;
- for (n = index_names; (idx = *n); n++)
+ idx = indices_info_index_by_name (index_names,
+ entry_index_name);
+
+ if (idx)
{
- if (!strcmp (idx->name, entry_index_name))
- {
- if (entry_idx_in_index < idx->entries_number)
- letter_entries->entries[k]
- = &idx->index_entries[entry_number];
- break;
- }
+ if (entry_idx_in_index < idx->entries_number)
+ letter_entries->entries[k]
+ = &idx->index_entries[entry_idx_in_index];
}
if (!letter_entries->entries[k])
{