texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: * tp/Texinfo/XS/main/build_perl_info.c (element_t


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/XS/main/build_perl_info.c (element_to_perl_hash): inline store_info_element in element_to_perl_hash.
Date: Wed, 23 Oct 2024 06:35:03 -0400

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 4791e09447 * tp/Texinfo/XS/main/build_perl_info.c 
(element_to_perl_hash): inline store_info_element in element_to_perl_hash.
4791e09447 is described below

commit 4791e09447250ff2b0bbfc1649ed651a9dea663a
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Oct 23 12:34:58 2024 +0200

    * tp/Texinfo/XS/main/build_perl_info.c (element_to_perl_hash): inline
    store_info_element in element_to_perl_hash.
---
 ChangeLog                            |  5 +++++
 tp/Texinfo/XS/main/build_perl_info.c | 35 +++++++++++++++--------------------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c3f9c392c6..49bb3af83b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-10-23  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/build_perl_info.c (element_to_perl_hash): inline
+       store_info_element in element_to_perl_hash.
+
 2024-10-23  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/tree.c (elt_info_names): add.
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index 14deab5898..acbcfcfa8e 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -623,23 +623,6 @@ setup_info_hv (ELEMENT *e, HV **info_hv)
     }
 }
 
-static void
-store_info_element (ELEMENT *e, ELEMENT *info_element,
-                    const char *key, int avoid_recursion, HV **info_hv)
-{
-  dTHX;
-
-  if (!info_element)
-    return;
-
-  if (!info_element->hv || !avoid_recursion)
-    element_to_perl_hash (info_element, avoid_recursion);
-
-  setup_info_hv (e, info_hv);
-  hv_store (*info_hv, key, strlen (key),
-            newRV_inc ((SV *)info_element->hv), 0);
-}
-
 static void
 store_info_string (ELEMENT *e, const char *string,
                    const char *key, HV **info_hv)
@@ -852,10 +835,22 @@ element_to_perl_hash (ELEMENT *e, int avoid_recursion)
 
   if (type_data[e->type].elt_info_number > 0)
     {
-      size_t i;
+      int i;
       for (i = 0; i < type_data[e->type].elt_info_number; i++)
-        store_info_element (e, e->elt_info[i], elt_info_names[i],
-                            avoid_recursion, &info_hv);
+        {
+          ELEMENT *info_element = e->elt_info[i];
+          if (info_element)
+            {
+              if (!info_element->hv || !avoid_recursion)
+                element_to_perl_hash (info_element, avoid_recursion);
+
+              setup_info_hv (e, &info_hv);
+
+              hv_store (info_hv, elt_info_names[i],
+                        strlen (elt_info_names[i]),
+                        newRV_inc ((SV *)info_element->hv), 0);
+           }
+       }
     }
 
   if (e->e.c->contents.number > 0)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]