Bug 128995 - Use std::swap() in HashTable::swap()
Summary: Use std::swap() in HashTable::swap()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zan Dobersek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-18 14:04 PST by Zan Dobersek
Modified: 2014-02-19 11:50 PST (History)
3 users (show)

See Also:


Attachments
Patch (2.10 KB, patch)
2014-02-18 14:05 PST, Zan Dobersek
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2014-02-18 14:04:55 PST
Use std::swap() in HashTable::swap()
Comment 1 Zan Dobersek 2014-02-18 14:05:51 PST
Created attachment 224544 [details]
Patch
Comment 2 Brent Fulgham 2014-02-19 11:19:55 PST
Comment on attachment 224544 [details]
Patch

It's nice to not reinvent the wheel!  Thanks for catching this.

Do we know if this gives any tiny microptimization based on the compiler being able to do moves instead of all of the copying? We probably don't measure enough to tell.
Comment 3 Zan Dobersek 2014-02-19 11:29:27 PST
Using Clang, Parser/HTML5-8266-ParseOnly.html runs about ~1%  faster when using libc++ (not substantial, but measurable) and regresses slightly when using libstdc++. Haven't tested with GCC.
Comment 4 WebKit Commit Bot 2014-02-19 11:50:15 PST
Comment on attachment 224544 [details]
Patch

Clearing flags on attachment: 224544

Committed r164378: <http://trac.webkit.org/changeset/164378>
Comment 5 WebKit Commit Bot 2014-02-19 11:50:17 PST
All reviewed patches have been landed.  Closing bug.