junrushao commented on code in PR #387:
URL: https://github.com/apache/tvm-ffi/pull/387#discussion_r2671579328
##########
src/ffi/dtype.cc:
##########
@@ -206,17 +206,46 @@ inline DLDataType
StringViewToDLDataType_(std::string_view str) {
dtype.bits = 32;
dtype.lanes = 1;
const char* scan;
+ const char* str_end = str.data() + str.length();
+
+ // Helper lambda to parse decimal digits from a bounded string_view
+ // Returns the parsed value and updates ptr to point past the last digit
+ auto parse_digits = [](const char*& ptr, const char* end) -> uint32_t {
Review Comment:
Oh sorry I misread. Yes in this case you will need `const char** ptr `
--
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]