refactor: avoid a few unnecessary strings (#47644)

* perf: replace string temporary with string_view in GetXdgAppId()

* perf: replace string temporary with string_view in ToV8(WindowOpenDisposition)

* perf: replace string temporary with string_view in ToV8(electron::api::WebContents::Type)
This commit is contained in:
Charles Kerr 2025-07-03 11:08:59 -05:00 committed by GitHub
commit bc585b6a3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -430,7 +430,7 @@ std::optional<std::string> GetDesktopName() {
std::string GetXdgAppId() {
if (std::optional<std::string> desktop_file_name = GetDesktopName()) {
const std::string kDesktopExtension{".desktop"};
constexpr std::string_view kDesktopExtension = ".desktop";
if (base::EndsWith(*desktop_file_name, kDesktopExtension,
base::CompareCase::INSENSITIVE_ASCII)) {
desktop_file_name->resize(desktop_file_name->size() -