performance improvements to CString (#9259)

- make sure CString("foo") calls the literal constructor
- avoid memory allocations when comparing to a literal
This commit is contained in:
Mathias Agopian
2025-09-25 13:57:53 -07:00
committed by GitHub
parent f9beffe3dc
commit a1b825b5b4
3 changed files with 111 additions and 13 deletions
-4
View File
@@ -53,10 +53,6 @@ CString::CString(size_t const length) {
}
}
CString::CString(const char* cstr)
: CString(cstr, size_type(cstr ? strlen(cstr) : 0)) {
}
CString::CString(const CString& rhs)
: CString(rhs.c_str(), rhs.size()) {
}