Use const references

This commit is contained in:
Samuel Attard 2017-09-05 18:01:27 +10:00 committed by Cheng Zhao
parent 0ddd078aaf
commit 448ccc261d
2 changed files with 4 additions and 4 deletions

View file

@ -177,10 +177,10 @@ Window::~Window() {
}
std::vector<base::FilePath::StringType> g_preloads;
void Window::AddGlobalPreload(const base::FilePath::StringType preloadPath) {
void Window::AddGlobalPreload(const base::FilePath::StringType& preloadPath) {
g_preloads.push_back(preloadPath);
}
void Window::RemoveGlobalPreload(const base::FilePath::StringType preloadPath) {
void Window::RemoveGlobalPreload(const base::FilePath::StringType& preloadPath) {
g_preloads.erase(
std::remove(g_preloads.begin(), g_preloads.end(), preloadPath),
g_preloads.end());

View file

@ -54,8 +54,8 @@ class Window : public mate::TrackableObject<Window>,
int32_t ID() const;
static void AddGlobalPreload(const base::FilePath::StringType preloadPath);
static void RemoveGlobalPreload(const base::FilePath::StringType preloadPath);
static void AddGlobalPreload(const base::FilePath::StringType& preloadPath);
static void RemoveGlobalPreload(const base::FilePath::StringType& preloadPath);
static std::vector<base::FilePath::StringType> GetGlobalPreloads();
protected: