limitedmap fixes and tests #6561

pull casey wants to merge 3 commits into bitcoin:master from casey:limitedmap changing 3 files +113 −8
  1. casey commented at 4:22 PM on August 17, 2015: contributor

    This PR consists of three commits.

    The first fixes a bug where the size of a limited map was actually one less than the maximum size set. This shouldn't matter at all for the existing code, since there is only one limitedmap, and its size is very large.

    The second disallows unlimited limited maps, since that doesn't make very much sense, and simplifies the code a little bit. (I'm not too attached to this, in case anyone doesn't like this change I can just remove it.)

    The third adds unit tests for limitedmap, which were previously absent.

    I elected to leave the commits unsquashed for review, since they're logically separate, but I can squash if desired.

  2. Make limited map actually respect max size fd2d862fbc
  3. Disallow unlimited limited maps 8b06894194
  4. Add limitedmap test 7bd57bb1d7
  5. casey renamed this:
    Limitedmap fixes
    limitedmap fixes and tests
    on Aug 17, 2015
  6. sipa commented at 9:20 PM on August 17, 2015: member

    ACK

  7. TheBlueMatt commented at 10:46 PM on August 17, 2015: member

    utACK

  8. laanwj commented at 1:43 PM on August 19, 2015: member

    utACK. Thanks a lot for adding tests!

  9. laanwj merged this on Aug 19, 2015
  10. laanwj closed this on Aug 19, 2015

  11. laanwj referenced this in commit e08a7d9d40 on Aug 19, 2015
  12. casey deleted the branch on Aug 19, 2015
  13. dcousens commented at 1:19 AM on August 20, 2015: contributor

    Is it worth adding a test to verify that insert after max_size is reached, it doesn't increment size? (Happy to do this)

  14. casey commented at 2:52 PM on August 20, 2015: contributor

    It does this already, unless you were thinking of a more substantial test: 11 elements are added (one one off, and then ten in a loop) and then line 39 checks that there are only 10 elements.

  15. dcousens commented at 10:03 PM on August 20, 2015: contributor

    Sorry, I missed that first insert @casey. utACK :)

  16. luke-jr referenced this in commit 4849c1f156 on Jan 9, 2016
  17. luke-jr referenced this in commit 4d09290b2c on Jan 9, 2016
  18. luke-jr referenced this in commit 49e9a861eb on Jan 10, 2016
  19. zkbot referenced this in commit e10008da66 on Feb 18, 2021
  20. zkbot referenced this in commit 777deea264 on Feb 19, 2021
  21. zkbot referenced this in commit b62e35dee8 on Feb 19, 2021
  22. 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-05-02 15:15 UTC

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