[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/HTML.pm (_sort_index_entries
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/HTML.pm (_sort_index_entries), tp/Texinfo/XS/main/get_perl_info.c (get_sv_index_entries_sorted_by_letter): pass index entries by letter directly as a hash. |
Date: |
Sun, 05 Nov 2023 16:15:07 -0500 |
This is an automated email from the git hooks/post-receive script.
pertusus pushed a commit to branch master
in repository texinfo.
The following commit(s) were added to refs/heads/master by this push:
new 2f16409fe1 * tp/Texinfo/Convert/HTML.pm (_sort_index_entries),
tp/Texinfo/XS/main/get_perl_info.c (get_sv_index_entries_sorted_by_letter):
pass index entries by letter directly as a hash.
2f16409fe1 is described below
commit 2f16409fe1568729b47fe39bedb6b5d2ffde7fe7
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Nov 5 22:14:58 2023 +0100
* tp/Texinfo/Convert/HTML.pm (_sort_index_entries),
tp/Texinfo/XS/main/get_perl_info.c
(get_sv_index_entries_sorted_by_letter): pass index entries by letter
directly as a hash.
---
ChangeLog | 7 +++++++
tp/Texinfo/Convert/HTML.pm | 11 +++--------
tp/Texinfo/XS/main/get_perl_info.c | 9 ++++++---
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4aba8d307d..271da2eb82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-11-05 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/HTML.pm (_sort_index_entries),
+ tp/Texinfo/XS/main/get_perl_info.c
+ (get_sv_index_entries_sorted_by_letter): pass index entries by letter
+ directly as a hash.
+
2023-11-05 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/HTML.pm (_sort_index_entries),
diff --git a/tp/Texinfo/Convert/HTML.pm b/tp/Texinfo/Convert/HTML.pm
index 901a1f1449..569b66d58c 100644
--- a/tp/Texinfo/Convert/HTML.pm
+++ b/tp/Texinfo/Convert/HTML.pm
@@ -9864,20 +9864,15 @@ sub _sort_index_entries($)
$self->{'index_entries'} = $merged_index_entries;
# pass sorted index entries to XS for a reproducible sorting.
+ # TODO is a reproducible sorting useful?
if ($self->{'converter_descriptor'} and $XS_convert) {
# Setup list of lists for easier import of data in C.
my $index_entries_by_letter = [];
if ($self->{'index_entries_by_letter'}) {
foreach my $index_name
(sort(keys(%{$self->{'index_entries_by_letter'}}))) {
- my $letter_entries
- = $self->{'index_entries_by_letter'}->{$index_name};
- my $index_by_letters = [];
- foreach my $letter_entry (@$letter_entries) {
- my $letter = $letter_entry->{'letter'};
- push @$index_by_letters, [$letter, $letter_entry->{'entries'}];
- }
- push @$index_entries_by_letter, [$index_name, $index_by_letters];
+ push @$index_entries_by_letter,
+ [$index_name, $self->{'index_entries_by_letter'}->{$index_name}];
}
}
_XS_get_index_entries_sorted_by_letter($self,
diff --git a/tp/Texinfo/XS/main/get_perl_info.c
b/tp/Texinfo/XS/main/get_perl_info.c
index b381a2276b..58ae178bde 100644
--- a/tp/Texinfo/XS/main/get_perl_info.c
+++ b/tp/Texinfo/XS/main/get_perl_info.c
@@ -1511,9 +1511,12 @@ get_sv_index_entries_sorted_by_letter (CONVERTER
*converter,
int k;
SSize_t entries_nr;
AV *entries_av;
- AV *letter_entries_av = (AV *) SvRV (*letter_entries_sv);
- SV **letter_sv = av_fetch (letter_entries_av, 0, 0);
- SV **entries_sv = av_fetch (letter_entries_av, 1, 0);
+
+ HV *letter_entries_hv = (HV *) SvRV (*letter_entries_sv);
+ SV **letter_sv = hv_fetch (letter_entries_hv, "letter",
+ strlen ("letter"), 0);
+ SV **entries_sv = hv_fetch (letter_entries_hv, "entries",
+ strlen ("entries"), 0);
if (!letter_sv || !entries_sv)
{
char *msg;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/HTML.pm (_sort_index_entries), tp/Texinfo/XS/main/get_perl_info.c (get_sv_index_entries_sorted_by_letter): pass index entries by letter directly as a hash.,
Patrice Dumas <=
- Prev by Date:
branch master updated: * tp/Texinfo/Convert/HTML.pm (_sort_index_entries), tp/Texinfo/XS/main/get_perl_info.c (get_sv_index_entries_sorted_by_letter): encode strings in get_sv_index_entries_sorted_by_letter by using SvPVutf8 instead of doing it in perl.
- Next by Date:
branch master updated: * tp/Texinfo/XS/main/get_perl_info.c, tp/Texinfo/XS/main/utils.h: remove more code related to sorting in C based on sortable entries from perl, get_sv_sortable_entries, KEY_ALPHA, SORTABLE_ENTRY and INDEX_SORTABLE_ENTRIES.
- Previous by thread:
branch master updated: * tp/Texinfo/Convert/HTML.pm (_sort_index_entries), tp/Texinfo/XS/main/get_perl_info.c (get_sv_index_entries_sorted_by_letter): encode strings in get_sv_index_entries_sorted_by_letter by using SvPVutf8 instead of doing it in perl.
- Next by thread:
branch master updated: * tp/Texinfo/XS/main/get_perl_info.c, tp/Texinfo/XS/main/utils.h: remove more code related to sorting in C based on sortable entries from perl, get_sv_sortable_entries, KEY_ALPHA, SORTABLE_ENTRY and INDEX_SORTABLE_ENTRIES.
- Index(es):