Do not shadow local variable named `tx`. #9587

pull paveljanik wants to merge 1 commits into bitcoin:master from paveljanik:20170119_Wshadow_net_processing changing 1 files +2 −2
  1. paveljanik commented at 7:41 PM on January 19, 2017: contributor

    #9499 brought in new shadowing warning:

    net_processing.cpp:1880:37: warning: declaration shadows a local variable [-Wshadow]
            for (const CTransactionRef& tx : lRemovedTxn)
                                        ^
    net_processing.cpp:1728:29: note: previous declaration is here
            const CTransaction& tx = *ptx;
                                ^
    1 warning generated.
    

    @TheBlueMatt Is _tx OK for you or do you prefer other name here? Like removedTx or so...

  2. fanquake added the label P2P on Jan 20, 2017
  3. fanquake added the label Refactoring on Jan 20, 2017
  4. dcousens commented at 5:09 AM on January 20, 2017: contributor

    removedTx?

  5. gmaxwell commented at 8:45 AM on January 20, 2017: contributor

    In many codebases underscore prefixes are used for function arguments; arguably they're even bad there because they're easy to confuse with non-prefix versions. Please don't pepper them into function bodies.

    itRemoveTx or removedTx as dcousens suggested would be fine.

  6. Do not shadow local variable named `tx`. 44f2baac48
  7. paveljanik force-pushed on Jan 20, 2017
  8. morcos commented at 7:57 PM on January 20, 2017: member

    utACK 44f2baa

  9. fanquake commented at 12:00 AM on January 21, 2017: member

    utACK 44f2baa

  10. laanwj merged this on Jan 26, 2017
  11. laanwj closed this on Jan 26, 2017

  12. laanwj referenced this in commit 10dc58a2aa on Jan 26, 2017
  13. gladcow referenced this in commit 990ebd05c6 on Mar 8, 2018
  14. gladcow referenced this in commit 30a8d1dbd3 on Mar 13, 2018
  15. gladcow referenced this in commit 5ac77b87db on Mar 14, 2018
  16. gladcow referenced this in commit 9234f37427 on Mar 15, 2018
  17. gladcow referenced this in commit 0e508945e5 on Mar 15, 2018
  18. gladcow referenced this in commit 08c46c4173 on Mar 15, 2018
  19. gladcow referenced this in commit 7adb84936f on Mar 15, 2018
  20. gladcow referenced this in commit 022c1f3ed5 on Mar 24, 2018
  21. gladcow referenced this in commit 39256a7373 on Apr 4, 2018
  22. UdjinM6 referenced this in commit bc45a2f87a on Apr 11, 2018
  23. andvgal referenced this in commit fd5c50bc2b on Jan 6, 2019
  24. CryptoCentric referenced this in commit dd3fd51204 on Feb 28, 2019
  25. DrahtBot locked this on Sep 8, 2021

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-04-22 06:15 UTC

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