Skip to content

[h01-comment-imprecise] [INFO] CTPOP_H01 comment '1 bytes for ctpop' is broken/uninformative #28

Description

@thedavidmeister

Dimension: 3 (documentation) · Severity: INFO

src/lib/LibCtPop.sol:21-22 — CTPOP_H01's comment /// @dev 1 bytes for ctpop is ungrammatical and does not describe the constant's role. 0x0101...01 is the multiplier used at line 36 ((x * CTPOP_H01) >> 248) to sum the per-byte partial popcounts into the most-significant byte.

Proposed fix — change line 21 to:

/// @dev 0x01 in every byte; multiplying by this sums the per-byte popcounts into the most-significant byte for ctpop.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions