Descriptionbookmarks: BookmarkNodeData's size() cleanups.
* Fix the implementation of has_single_url() method.
It is incorrect to check is_valid() because the elements
vector can contain more than 1 item. And thus the
is_valid() check does not make sense, since it just check
if the vector is not empty, not that it just contains one element.
* Use is_valid() method when possible.
* Use has_single_url() method when it makes sense.
* Use data.size() to avoid a temp variable.
BUG=None
TEST=chrome still links and works as before, existing unit tests in components_unittests.
R=sky@chromium.org
Committed: https://crrev.com/b2ab3b4ff4a883fd6cd4efc31bec8990ad4fa249
Cr-Commit-Position: refs/heads/master@{#313702}
Patch Set 1 #Patch Set 2 : chromeos fixes #Patch Set 3 : linux fixes #Patch Set 4 : elements.size() #Patch Set 5 : fix the implementation of has_single_url() #
Total comments: 2
Patch Set 6 : size() #
Total comments: 2
Patch Set 7 : review #
Messages
Total messages: 11 (2 generated)
|