Skip to content

examples that use "lines.max" for "longest line" are wrong #28

@timo

Description

@timo

the max of a list of lines is the lexicographically last, for example if there's a single line in the file that starts with a z, it's quite likely to be the "max" even though it could be just one letter long.

instead, you want to use .max(*.chars), which will compare the number of characters of all lines to find the longest line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions