mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: avoid a few unnecessary strings (#47655)
* perf: replace string temporary with string_view in GetXdgAppId() Co-authored-by: Charles Kerr <charles@charleskerr.com> * perf: replace string temporary with string_view in ToV8(WindowOpenDisposition) Co-authored-by: Charles Kerr <charles@charleskerr.com> * perf: replace string temporary with string_view in ToV8(electron::api::WebContents::Type) Co-authored-by: Charles Kerr <charles@charleskerr.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
@@ -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() -
|
||||
|
||||
Reference in New Issue
Block a user