zivid / zivid-python

Official Python package for Zivid 3D cameras
BSD 3-Clause "New" or "Revised" License
43 stars 14 forks source link

DataModelWrapper::toSnakeCase: Take string_view #132

Closed anordal closed 3 years ago

anordal commented 3 years ago

This function does not modify its string argument, i.e. can use std::string_view, assuming C++17. This avoids implicit std::string temporaries.

Also fixes a use-after-free of the form:

toSnakeCase(name).c_str()

This aligns the function with the one in SDK, including a couple of unrelated changes:

Implements #93

anordal commented 3 years ago

(I split the commit in 3, no change).

Sorry, Mathias, I see you had some review comment(s), but they went away (dunno why).

anordal commented 3 years ago

Moved to #133: The CI jobs don't start when the PR is from an external repository.