[all-commits] [llvm/llvm-project] b391e8: [libc++] Remove redundant assignments in bitset st...

Peng Liu via All-commits all-commits at lists.llvm.org
Tue Mar 18 09:06:03 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b391e80f52f4248e4e2b766c25f83d5e62ef2d56
      https://github.com/llvm/llvm-project/commit/b391e80f52f4248e4e2b766c25f83d5e62ef2d56
  Author: Peng Liu <winner245 at hotmail.com>
  Date:   2025-03-18 (Tue, 18 Mar 2025)

  Changed paths:
    M libcxx/include/bitset

  Log Message:
  -----------
  [libc++] Remove redundant assignments in bitset string-like constructors (#121424)

The following three string-like constructors for `std::bitset` 
- `bitset(const CharT* str, std::size_t n, CharT zero, CharT one)`;
- `bitset(const std::basic_string<CharT, Traits, Alloc>& str, typename
std::basic_string<CharT, Traits, Alloc>::size_type pos, CharT zero,
CharT one)`;
- `bitset(std::basic_string_view<CharT, Traits> str, std::size_t pos,
std::size_t n, CharT zero, CharT one)`

already initialize the underlying storage array to all zeroes via
default-constructor of the base class `__bitset`. Therefore,
re-assigning the storage array to zeroes via `std::fill_n` in the
string-like constructors is truly redundant.



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


More information about the All-commits mailing list