BLI: Avoid computing size when referencing std::string
The std::string already knows its size; there's no need to find it from scratch. Pull Request: https://projects.blender.org/blender/blender/pulls/117757
This commit is contained in:
@@ -449,7 +449,10 @@ inline StringRefNull::StringRefNull(const char *str) : StringRefBase(str, int64_
|
||||
* Reference a std::string. Remember that when the std::string is destructed, the StringRefNull
|
||||
* will point to uninitialized memory.
|
||||
*/
|
||||
inline StringRefNull::StringRefNull(const std::string &str) : StringRefNull(str.c_str()) {}
|
||||
inline StringRefNull::StringRefNull(const std::string &str)
|
||||
: StringRefNull(str.c_str(), int64_t(str.size()))
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the char at the given index.
|
||||
|
||||
Reference in New Issue
Block a user