[all-commits] [llvm/llvm-project] 4d20cf: [libc++] Simplify single-iterator __bit_iterator a...

philnik777 via All-commits all-commits at lists.llvm.org
Thu Jul 27 14:57:59 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d20cfcf4eb08217ed37c4d4c38dc395d7a66d26
      https://github.com/llvm/llvm-project/commit/4d20cfcf4eb08217ed37c4d4c38dc395d7a66d26
  Author: Nikolas Klauser <nikolasklauser at berlin.de>
  Date:   2023-07-27 (Thu, 27 Jul 2023)

  Changed paths:
    M libcxx/include/__bit_reference
    M libcxx/include/bitset

  Log Message:
  -----------
  [libc++] Simplify single-iterator __bit_iterator algorithm specializations

The single-iterator algorithms have an implementation for `false` and `true`, which are almost identical. Instead of writing two functions, this refactors the code to take the value searched for as a template parameter. This avoids a lot of code duplication and makes it easier to reason about the algorithm and their difference.

Reviewed By: #libc, Mordante

Spies: Mordante, libcxx-commits

Differential Revision: https://reviews.llvm.org/D156033




More information about the All-commits mailing list