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:
parent
4c460df0a4
commit
bc585b6a3f
2 changed files with 3 additions and 3 deletions
|
@ -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() -
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue