eof: Change handling of errors from pair<val, err> to variant<val, err>#572
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #572 +/- ##
=======================================
Coverage 96.94% 96.95%
=======================================
Files 67 67
Lines 6228 6232 +4
=======================================
+ Hits 6038 6042 +4
Misses 190 190
Flags with carried forward coverage won't be shown. Click here to find out more.
|
| return EOFValidationError::eof_version_unknown; | ||
| return validate_eof1(rev, container).second; | ||
|
|
||
| const auto header_or_error = validate_eof1(rev, container); |
There was a problem hiding this comment.
It seems this function isn't even using the returned EOF1Header and so the entire deal with pair/variant seems useless.
There was a problem hiding this comment.
For simplicity we can change validate_eof1() to return only error.
There was a problem hiding this comment.
We can also make pubic validate_eof() return variant, in general it seems useful to be able to validate and parse in one go.
But currently I found that it could be useful only in eofparse (which does validate_eof() + read_valid_eof1_header() combo)
State test runner seems to do these two operations in different places.
|
Ah I see it's the same commit (I was the author) |
I actually duplicated the change from the final diff and was lazy to find the actual commit. Will change the author then. |
This helps to reduce stack usage of large functions like validate_eof_headers(). Co-authored-by: Alex Beregszaszi <[email protected]>
eof: Change handling of errors from pair<val, err> to variant<val, err>
Pulled out of #563, but not sure who the author is.