diff options
author | Max Kellermann <max@duempel.org> | 2014-01-10 21:27:36 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-10 22:59:01 +0100 |
commit | f4490f6918a1b481c535b1b63179edb78382e02e (patch) | |
tree | 35f0a5f7eb08902922af1b9b9fb5b4d7b7f957af /src/Expat.cxx | |
parent | dadd987bf441324bf8824c16f3ac0798da652083 (diff) | |
download | mpd-f4490f6918a1b481c535b1b63179edb78382e02e.tar.gz mpd-f4490f6918a1b481c535b1b63179edb78382e02e.tar.xz mpd-f4490f6918a1b481c535b1b63179edb78382e02e.zip |
db/upnp/Directory: eliminate the "attributes" std::map
Look up attributes in the "atts" array. Reduce bloat.
Diffstat (limited to 'src/Expat.cxx')
-rw-r--r-- | src/Expat.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Expat.cxx b/src/Expat.cxx index 82dce7682..5cee45912 100644 --- a/src/Expat.cxx +++ b/src/Expat.cxx @@ -70,6 +70,17 @@ ExpatParser::Parse(InputStream &is, Error &error) } const char * +ExpatParser::GetAttribute(const XML_Char **atts, + const char *name) +{ + for (unsigned i = 0; atts[i] != nullptr; i += 2) + if (strcmp(atts[i], name) == 0) + return atts[i + 1]; + + return nullptr; +} + +const char * ExpatParser::GetAttributeCase(const XML_Char **atts, const char *name) { |