Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A typo about FirstChildElement() & LastChildElement() ? #49

Closed
CodeVisio opened this issue Jul 29, 2012 · 1 comment
Closed

A typo about FirstChildElement() & LastChildElement() ? #49

CodeVisio opened this issue Jul 29, 2012 · 1 comment

Comments

@CodeVisio
Copy link

Hi,

I've noticed that while inside XMLNode::FirstChildElement() & XMLNode::LastChildElement() functions
at the string matching level you're using the Name() function of XMLElement (and so a conversion with ToElement()),
inside XMLNode::NextSiblingElement() & XMLNode::PreviousSiblingElement() you're using the Value() function of XMLNode directly. Indeed, Name() function of XMLElement is just a call to Value() function of XMLNode and Value() is not a virtual functions, that is a potential overrideable function.
What do you think?
could we assume Value() instead of Name() inside XMLNode::FirstChildElement() & XMLNode::LastChildElement() avoiding the ToElement() function call?

Let me know if it is unclear,
Thanks

@leethomason
Copy link
Owner

For an XMLElement, Name() and Value() are aliases. Shouldn't have any performance impact.

const char* Name() const { return Value(); }

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants