perf: prefer base::SplitStringPiece()
over base::SplitString()
(#45947)
* perf: use base::SplitStringPiece() in SetNodeOptions() Co-authored-by: Charles Kerr <charles@charleskerr.com> * perf: use base::SplitStringPiece() in StringToAccelerator() Co-authored-by: Charles Kerr <charles@charleskerr.com> * refactor: StringToAccelerator() now takes a std::string_view 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:
parent
d41ed8a118
commit
f90de88c63
3 changed files with 9 additions and 8 deletions
|
@ -6,7 +6,7 @@
|
|||
#define ELECTRON_SHELL_BROWSER_UI_ACCELERATOR_UTIL_H_
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "shell/browser/ui/electron_menu_model.h"
|
||||
|
@ -21,7 +21,7 @@ typedef struct {
|
|||
typedef std::map<ui::Accelerator, MenuItem> AcceleratorTable;
|
||||
|
||||
// Parse a string as an accelerator.
|
||||
bool StringToAccelerator(const std::string& shortcut,
|
||||
bool StringToAccelerator(std::string_view shortcut,
|
||||
ui::Accelerator* accelerator);
|
||||
|
||||
// Generate a table that contains menu model's accelerators and command ids.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue