From: Daniel Jacobowitz <dan@codesourcery.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Don't assume order of xml attributes
Date: Wed, 02 Feb 2011 16:34:00 -0000 [thread overview]
Message-ID: <20110202163343.GA9355@caradoc.them.org> (raw)
In-Reply-To: <201102021619.36863.pedro@codesourcery.com>
On Wed, Feb 02, 2011 at 04:19:36PM +0000, Pedro Alves wrote:
> Something I noticed by inspection while adding support for
> a new xml file fetched with qXfer:$object.
>
> XML attributes are not ordered. We should not
> rely on attribute order for anything. This patch
> adds a helper function to get at a given attribute by name,
> and updates all places to use it instead of refering to
> attributes by index.
This was not required. The attributes don't have to be ordered in the
XML file, but they're ordered in the VEC because we create it that way
in gdb_start_element. You can tell your patch still relies on this
code because the calls to the lookup function mostly don't check for
NULL.
That said, I don't think a linear search for attribute names is going
to be too slow :-) So this is a nice readability improvement anyway.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2011-02-02 16:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-02 16:19 Pedro Alves
2011-02-02 16:34 ` Daniel Jacobowitz [this message]
2011-02-02 17:00 ` Pedro Alves
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=20110202163343.GA9355@caradoc.them.org \
--to=dan@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/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