You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The opentracing shim does a few conversions in either direction between the implementation of opentracing::string_view to nostd::string_view, by constructing the target with just the .data() part.
The approach might be OK as is, in general, but is highly speculative on the source buffer being null terminated. The alternative is explicitly constructing the target string view with the size of the buffer.
For instance, the proper mapping in shim_utils.h L32 would look like this:
This would make it for the correct use of string view at the expense of a bit more verbosity.
This also improves performances, saving a call to strlen().
marcalff
added
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
and removed
needs-triage
Indicates an issue or PR lacks a `triage/foo` label and requires one.
labels
Dec 2, 2024
The opentracing shim does a few conversions in either direction between the implementation of
opentracing::string_view
tonostd::string_view
, by constructing the target with just the.data()
part.The approach might be OK as is, in general, but is highly speculative on the source buffer being null terminated. The alternative is explicitly constructing the target string view with the size of the buffer.
For instance, the proper mapping in shim_utils.h L32 would look like this:
This would make it for the correct use of string view at the expense of a bit more verbosity.
The text was updated successfully, but these errors were encountered: