[libcxx-commits] [PATCH] D116486: [libc++][NFC] Use _LIBCPP_DEBUG_ASSERT in <__hash_table>

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 2 08:54:03 PST 2022


Mordante added inline comments.


================
Comment at: libcxx/include/__hash_table:2488
+                         "unordered container erase(iterator) called with a non-dereferenceable iterator");
 #if _LIBCPP_DEBUG_LEVEL == 2
     iterator __r(__np, this);
----------------
philnik wrote:
> Mordante wrote:
> > In this case I have a slight preference to keep the original code, since it doesn't remove the `#if`. But I won't object against the change.
> I found it much easier to read the code because you have the
> ```
> #if _LIBCPP_DEBUG_LEVEL == 2
>   do_something();
> #else
>   do_essentially_the_same_thing();
> #endif
> ```
> all over this file, but almost never any assertions in the if block. Now you never have assertions in the same #if block.
I hadn't looked at the entire file. But I see what you mean. Then let's keep your changes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116486/new/

https://reviews.llvm.org/D116486



More information about the libcxx-commits mailing list