[webkit-changes] [WebKit/WebKit] c5de93: Use find instead of contains for unordered_map

Ross Kirsling noreply at github.com
Tue Dec 5 20:03:36 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c5de9361d7352eeb0c9c62ec675a3d32f1d63499
      https://github.com/WebKit/WebKit/commit/c5de9361d7352eeb0c9c62ec675a3d32f1d63499
  Author: Ross Kirsling <ross.kirsling at sony.com>
  Date:   2023-12-05 (Tue, 05 Dec 2023)

  Changed paths:
    M Source/WebCore/platform/graphics/SourceBufferPrivate.cpp

  Log Message:
  -----------
  Use find instead of contains for unordered_map
https://bugs.webkit.org/show_bug.cgi?id=265920

Reviewed by Don Olmstead.

Build fix for PlayStation.
`map.contains(element)` may read nicely, but `map.find(element) != map.end()` is still a one-liner.
Let's stick to the latter for the moment since it's non-trivial to add a new method to an existing STL container.

* Source/WebCore/platform/graphics/SourceBufferPrivate.cpp:
(WebCore::SourceBufferPrivate::addTrackBuffer):
(WebCore::SourceBufferPrivate::validateInitializationSegment):

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




More information about the webkit-changes mailing list