junrushao commented on code in PR #78:
URL: https://github.com/apache/tvm-ffi/pull/78#discussion_r2409166788
##########
include/tvm/ffi/string.h:
##########
@@ -924,11 +931,11 @@ struct TypeTraits<std::string>
return std::string(src->data, src->size);
}
- TVM_FFI_INLINE static std::string ConvertFallbackValue(Bytes src) {
+ TVM_FFI_INLINE static std::string ConvertFallbackValue(const Bytes& src) {
Review Comment:
Looks like it's a complex case.
- `Byte` can't be moved into `std::string` without an extra copy, which
means analyzing locally on `ConvertFallbackValue` doesn't provide sufficient
evidence to prefer `Bytes` to `const Bytes&`;
- However, when being invoked, `ConvertFallbackValue`'s arguments are always
moved into. That said, `Bytes` is indeed better than `const Bytes&`.
--
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]