Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7375405d8e932dbeff9ca85317097e79a45d0f83
      
https://github.com/WebKit/WebKit/commit/7375405d8e932dbeff9ca85317097e79a45d0f83
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-08-16 (Sun, 16 Aug 2026)

  Changed paths:
    M Source/WTF/wtf/text/Base64.cpp

  Log Message:
  -----------
  [WTF] Base64 encode/decode maps are copied by value on every call
https://bugs.webkit.org/show_bug.cgi?id=321839
rdar://184983791

Reviewed by Chris Dumez.

base64EncodeInternal() and base64DecodeInternal() select between the standard
and URL-safe lookup tables with a conditional expression bound to `auto`, which
copies the whole std::array into a local on every call: 64 bytes for the encode
map and 128 bytes for the decode map.

A conditional expression over two lvalues of the same type is itself an lvalue,
so binding with `auto&` instead is sufficient to reference the constexpr table
directly. The decode path in particular runs for every data: URL, WebCrypto
base64url operation, and WebSocket handshake key check.

No behavior change, so no new tests.

* Source/WTF/wtf/text/Base64.cpp:
(WTF::base64EncodeInternal):
(WTF::base64DecodeInternal):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to