Skip to content

Consumed=0 vs raising Exceptions #74

@pkese

Description

@pkese

I'm parsing lots of CSV files where values are empty - i.e. just ,,,, columns in CSV.

System.Buffers.Text.Utf8Parser.TryParse will in this case simply return consumed=0
whereas csFastFloat in such case raises System.ArgumentException.

The problem is that in such case I have to either make additional checks before calling ParseFloat
or even handling exceptions which makes the code much slower.

I'd suggest to change the behaviour of functions accepting consumed to not raise exceptions in such cases,
but rather set consumed=0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions