refactor: Remove unused CDataStream SerializeMany constructor #26992

pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2301-ser-many-remove-💻 changing 2 files +2 −9
  1. maflcko commented at 12:21 PM on January 30, 2023: member

    Seems odd to have an unused method. Moreover, the function is fragile and dangerous, because one could have a std::vector vec_a and type CDataStream{vec_a, 0, 0}.size() and CDataStream{0, 0, vec_a}.size(), assuming they are the same thing, when in fact they are not. (The first takes over the memory as is, the second serializes the vector).

    So my suggestion would be to remove the unused method and introduce a new method when this functionality is needed. For example: static DataStream FromMany(Args&&... args).

  2. refactor: Remove unused CDataStream SerializeMany constructor fa47b28dfc
  3. DrahtBot commented at 12:22 PM on January 30, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK stickies-v

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

  4. DrahtBot added the label Refactoring on Jan 30, 2023
  5. fanquake requested review from stickies-v on Jan 30, 2023
  6. fanquake requested review from aureleoules on Jan 30, 2023
  7. stickies-v approved
  8. stickies-v commented at 10:40 AM on February 1, 2023: contributor

    ACK fa47b28dfc2a6577519e10da68ebd8da93568434

    No need for this unused constructor, and as per OP, can be reimplemented in a less ambiguous way if/when it is needed.

  9. fanquake merged this on Feb 2, 2023
  10. fanquake closed this on Feb 2, 2023

  11. maflcko deleted the branch on Feb 2, 2023
  12. sidhujag referenced this in commit bb161ae89c on Feb 3, 2023
  13. bitcoin locked this on Feb 2, 2024


aureleoules


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:13 UTC

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