Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 79257f1abce6b48700b632f007b903e7ea7d279e
      
https://github.com/WebKit/WebKit/commit/79257f1abce6b48700b632f007b903e7ea7d279e
  Author: Chris Dumez <[email protected]>
  Date:   2026-03-29 (Sun, 29 Mar 2026)

  Changed paths:
    M Source/WTF/wtf/FixedVector.h
    M Tools/TestWebKitAPI/Tests/WTF/FixedVector.cpp

  Log Message:
  -----------
  Simplify FixedVector move assignment operator
https://bugs.webkit.org/show_bug.cgi?id=310964

Reviewed by Geoffrey Garen.

The move assignment operator used the copy-and-swap idiom, which is
unnecessary for a class whose only member is a unique_ptr. Replace
it with `= default`, which directly move-assigns the unique_ptr.

Also add test coverage for move-assigning over a non-empty vector,
verifying that old elements are properly destroyed.

Test: Tools/TestWebKitAPI/Tests/WTF/FixedVector.cpp

* Source/WTF/wtf/FixedVector.h:
* Tools/TestWebKitAPI/Tests/WTF/FixedVector.cpp:
(TestWebKitAPI::TEST(WTF_FixedVector, MoveAssignNonEmptyToNonEmpty)):
(TestWebKitAPI::TEST(WTF_FixedVector, MoveAssignEmptyToEmpty)):

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



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

Reply via email to