Skip to content

chore: use more from_chars#186

Merged
zeroshade merged 1 commit intoapache:mainfrom
zhjwpku:refactor_from_chars
Aug 22, 2025
Merged

chore: use more from_chars#186
zeroshade merged 1 commit intoapache:mainfrom
zhjwpku:refactor_from_chars

Conversation

@zhjwpku
Copy link
Copy Markdown
Collaborator

@zhjwpku zhjwpku commented Aug 20, 2025

No description provided.

Copy link
Copy Markdown
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one question, but otherwise looks good to me


return std::stoi(std::string(field_id_value.data, field_id_value.size_bytes));
int32_t field_id = kUnknownFieldId;
std::from_chars(field_id_value.data, field_id_value.data + field_id_value.size_bytes,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this check the ec return also?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If ec is std::errc(), the field_id is still kUnknownFieldId, this check is unnecessary.

@zeroshade zeroshade merged commit 515b019 into apache:main Aug 22, 2025
7 checks passed
@zhjwpku zhjwpku deleted the refactor_from_chars branch August 29, 2025 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants