refactor: Fix “modernize-use-starts-ends-with” clang-tidy warning #31480

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:241212-tidy changing 1 files +1 −1
  1. hebasto commented at 10:27 am on December 12, 2024: member

    This PR is a follow-up to #31306 and fixes the “modernize-use-starts-ends-with” warning in the multiprocess code (see #30975 (comment)).

    Fixes https://github.com/chaincodelabs/libmultiprocess/issues/124.

  2. hebasto added the label Refactoring on Dec 12, 2024
  3. DrahtBot commented at 10:27 am on December 12, 2024: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK l0rinc, theuni, ryanofsky
    Stale ACK maflcko

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. maflcko commented at 11:23 am on December 12, 2024: member
    lgtm ACK db82a91f175d38b5e3f3c2983095cd82bba30abf
  5. in src/ipc/process.cpp:75 in db82a91f17 outdated
    71@@ -72,7 +72,7 @@ static bool ParseAddress(std::string& address,
    72                   struct sockaddr_un& addr,
    73                   std::string& error)
    74 {
    75-    if (address.compare(0, 4, "unix") == 0 && (address.size() == 4 || address[4] == ':')) {
    76+    if (address.starts_with("unix") && (address.size() == 4 || address[4] == ':')) {
    


    l0rinc commented at 11:46 am on December 12, 2024:

    I think we can simplify this further:

    0    if (address == "unix" || address.starts_with("unix:")) {
    

    hebasto commented at 11:54 am on December 12, 2024:
    The suggestion has been accepted.
  6. l0rinc changes_requested
  7. refactor: Fix "modernize-use-starts-ends-with" clang-tidy warning df27ee9f02
  8. hebasto force-pushed on Dec 12, 2024
  9. l0rinc commented at 1:52 pm on December 12, 2024: contributor
    ACK df27ee9f024f69a8bdac8b0ee3bd7882f6a54294
  10. DrahtBot requested review from maflcko on Dec 12, 2024
  11. theuni approved
  12. theuni commented at 8:53 pm on December 12, 2024: member

    utACK df27ee9f024f69a8bdac8b0ee3bd7882f6a54294

    This is much more readable too :)

  13. ryanofsky approved
  14. ryanofsky commented at 10:03 pm on December 12, 2024: contributor
    Code review ACK df27ee9f024f69a8bdac8b0ee3bd7882f6a54294
  15. ryanofsky merged this on Dec 12, 2024
  16. ryanofsky closed this on Dec 12, 2024

  17. hebasto deleted the branch on Dec 13, 2024

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: 2024-12-21 12:12 UTC

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