Simpler return value of HashTable::add/HashMap:add and others
The current return value of HashTable::add() is a bool paired
with an iterator object. The creation and destruction of that
iterator object contributed to code size and since it was only
used at a few places it was not worth it.
Instead, let us return a bool paired with a pointer to the stored
object. That is after all what the code using the iterator object
wanted to have. I renamed the variable iterator -> storedValue
which is 99% [magic number] of the patch. Most users of HashTable
did not access iterator and did not have to change at all.
This change saves roughly 100 KB binary size of an x64 content_shell
built with clang. Other compilers, other architectures will save
different amounts, most likely less since most are not 64 bit.
The save is both in the instantiated ::add methods that don't have
to create an iterator object, and in the callers that don't have
to copy and destroy it.
R=morrita@chromium.org
RSR=eseidel@chromium.org
Review URL: https://codereview.chromium.org/167123002
git-svn-id: svn://svn.chromium.org/blink/trunk@167217 bbb929c8-8fbe-4397-9dbb-9b2b20218538
85 files changed