Skip to content

Commit

Permalink
operator== could be faster by checking node identity
Browse files Browse the repository at this point in the history
  • Loading branch information
rressi committed Apr 23, 2017
1 parent db00e93 commit dabb88e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions json11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ const Json & JsonArray::operator[] (size_t i) const {
bool Json::operator== (const Json &other) const {
if (m_ptr->type() != other.m_ptr->type())
return false;
if (m_ptr == other.m_ptr)
return true;

return m_ptr->equals(other.m_ptr.get());
}
Expand Down

0 comments on commit dabb88e

Please sign in to comment.