util: Replace !ContainsNoNUL() with ContainsNUL() #36102

pull hodlinator wants to merge 1 commits into bitcoin:master from hodlinator:2026/08/ContainsNUL changing 6 files +19 −19
  1. hodlinator commented at 2:47 PM on August 27, 2026: contributor

    Avoids frequent double negation. See also fa7078d84fc2858a466bc1a85404f821df682538 when it was renamed from the previous name, "ValidAsCString()".

    Found while reviewing #35041.

  2. refactor: Replace !ContainsNoNUL() with ContainsNUL()
    Avoids frequent double negation. See also fa7078d84fc2858a466bc1a85404f821df682538 when it was renamed from the previous name, "ValidAsCString()".
    8d930981e9
  3. DrahtBot added the label Utils/log/libs on Aug 27, 2026
  4. DrahtBot commented at 2:48 PM on August 27, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/36102.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    ACK sedited, janb84, maflcko, l0rinc

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  5. sedited approved
  6. sedited commented at 3:57 PM on August 27, 2026: contributor

    ACK 8d930981e9e16e26695173a378d4c9a044854fb7

  7. in src/test/fuzz/string.cpp:103 in 8d930981e9
      99 | @@ -100,7 +100,7 @@ FUZZ_TARGET(string)
     100 |      (void)TrimString(random_string_1);
     101 |      (void)TrimString(random_string_1, random_string_2);
     102 |      (void)UrlDecode(random_string_1);
     103 | -    (void)ContainsNoNUL(random_string_1);
     104 | +    (void)ContainsNUL(random_string_1);
    


    janb84 commented at 4:14 PM on August 27, 2026:

    ~is this one correct ? I do not see a ! before the ContainsNoNUL and I do not see any related code changed/inverted. I'm probably missing something~

    Edit: I see the void which ignores the result obv. nevermind.

  8. janb84 commented at 4:35 PM on August 27, 2026: contributor

    ACK 8d930981e9e16e26695173a378d4c9a044854fb7

    The double negative is unnecessary cognitive load and easy to do wrong. code review, build & tested. lgtm

  9. maflcko commented at 4:35 PM on August 27, 2026: member

    lgtm ACK 8d930981e9e16e26695173a378d4c9a044854fb7

  10. l0rinc commented at 5:33 PM on August 27, 2026: contributor

    code review ACK 8d930981e9e16e26695173a378d4c9a044854fb7

  11. sedited merged this on Aug 31, 2026
  12. sedited closed this on Aug 31, 2026

  13. Kino1994 referenced this in commit a4d15e27f2 on Sep 6, 2026
  14. hodlinator deleted the branch on Sep 21, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-10-11 10:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me