wgtmac commented on code in PR #845:
URL: https://github.com/apache/iceberg-cpp/pull/845#discussion_r3701223170


##########
src/iceberg/schema_internal.cc:
##########
@@ -240,9 +240,14 @@ int32_t GetFieldId(const ArrowSchema& schema) {
     return kUnknownFieldId;
   }
 
-  int32_t field_id = kUnknownFieldId;
-  std::from_chars(field_id_value.data, field_id_value.data + 
field_id_value.size_bytes,
-                  field_id);
+  int32_t field_id = 0;
+  const auto* end = field_id_value.data + field_id_value.size_bytes;
+  const auto [ptr, ec] = std::from_chars(field_id_value.data, end, field_id);

Review Comment:
   What about using `ParseNumber<int32_t>` to simplify this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to