public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Xiaole He <hexiaole1994@126.com>
To: libabigail@sourceware.org
Cc: Xiaole He <hexiaole1994@126.com>, Xiaole He <hexiaole@kylinos.cn>
Subject: [PATCH] abg-reader: fix comment of function
Date: Mon, 19 Sep 2022 18:03:50 +0800	[thread overview]
Message-ID: <20220919100350.9661-1-hexiaole1994@126.com> (raw)

In 'src/abg-reader.cc', the function
'walk_xml_node_to_map_type_ids(read_context& ctxt, xmlNodePtr node)'
find all of the child nodes of 'node' that has the 'id' attribute,
and then put the child node into map where the 'id' of the child node
as key and the child node itself as the value.
But the comment for this function writes:
/* src/abg-reader.cc begin */
/// Walk an entire XML sub-tree to build a map where the key is the
/// the value of the 'id' attribute (for type definitions) and the key
/// is the xml node containing the 'id' attribute.
...
static void
walk_xml_node_to_map_type_ids(read_context& ctxt,
                              xmlNodePtr node)
...
/* src/abg-reader.cc end */
The second and third lines of the comment above says the the child node
as the key of the map, but it should be the value of the map.
This patch fix the problematic comment described above, from
'and the key is the xml node' to 'and the value is the xml node'.

        * src/abg-reader.cc (walk_xml_node_to_map_type_ids): fix comment

Signed-off-by: Xiaole He <hexiaole@kylinos.cn>
---
 src/abg-reader.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/abg-reader.cc b/src/abg-reader.cc
index be2b8c13..b6372e50 100644
--- a/src/abg-reader.cc
+++ b/src/abg-reader.cc
@@ -1538,7 +1538,7 @@ advance_cursor(read_context& ctxt)
 }
 
 /// Walk an entire XML sub-tree to build a map where the key is the
-/// the value of the 'id' attribute (for type definitions) and the key
+/// the value of the 'id' attribute (for type definitions) and the value
 /// is the xml node containing the 'id' attribute.
 ///
 /// @param ctxt the context of the reader.
-- 
2.27.0


             reply	other threads:[~2022-09-19 10:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19 10:03 Xiaole He [this message]
2022-09-20  8:22 ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220919100350.9661-1-hexiaole1994@126.com \
    --to=hexiaole1994@126.com \
    --cc=hexiaole@kylinos.cn \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).