[webkit-changes] [WebKit/WebKit] c1279e: Optimize WTF::compactMap()

Chris Dumez noreply at github.com
Fri Nov 3 11:37:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c1279eabfb2112a7ec3b76ee453243b1e6fc66b5
      https://github.com/WebKit/WebKit/commit/c1279eabfb2112a7ec3b76ee453243b1e6fc66b5
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-11-03 (Fri, 03 Nov 2023)

  Changed paths:
    M Source/WTF/wtf/Vector.h
    M Source/WebCore/css/StylePropertyShorthand.h

  Log Message:
  -----------
  Optimize WTF::compactMap()
https://bugs.webkit.org/show_bug.cgi?id=264114

Reviewed by Darin Adler.

Optimize WTF::compactMap() by having it initialize vector capacity and rely
on Vector's unsafeAppendWithoutCapacityCheck(), similarly to WTF::map().

* Source/WTF/wtf/Vector.h:
(WTF::compactMap):
* Source/WebCore/css/StylePropertyShorthand.h:
(WTF::containerSize):

Canonical link: https://commits.webkit.org/270194@main




More information about the webkit-changes mailing list