mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Many of our labeling APIs accepted a std::string. When provided with a string literal (const char*), this would force the allocation of a new std::string object and a copy of the original char*. std::string_view is a view of either a std::string, or a const char* (or other), which allows an API that doesn not need to store the string to accept both without a copy. Of course, we can't store a std::string_view, as that doesn't provide memory ownership - so many of the GLES implementations will still copy the string_view into a string locally. Also updates several of the debug labelling functions to no-op in release mode and removes some expensive interpolations that aren't super necessary.