[webkit-reviews] review granted: [Bug 19159] Inspector should support console.time/console.timeEnd : [Attachment 21978] Fixed bug.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jun 27 22:42:43 PDT 2008
Darin Adler <darin at apple.com> has granted Keishi Hattori
<casey.hattori at gmail.com>'s request for review:
Bug 19159: Inspector should support console.time/console.timeEnd
https://bugs.webkit.org/show_bug.cgi?id=19159
Attachment 21978: Fixed bug.
https://bugs.webkit.org/attachment.cgi?id=21978&action=edit
------- Additional Comments from Darin Adler <darin at apple.com>
This looks good.
For this here, there's a more efficient, but less good looking way to do it:
+ if (!m_times.contains(title))
+ return false;
+
+ double startTime = m_times.take(title);
Instead you can do:
HashMap<String, double>::iterator it = m_times.find(title);
if (it == m_times.end())
return false;
double startTime = it->second;
m_times.remove(it);
The more complicated version does only one hash table lookup and so is more
efficient.
r=me as-is
More information about the webkit-reviews
mailing list