Make `add_blacklist` const&

Might be optimized by compiler already but who knows.
pull/460/head
jackun 4 years ago
parent 72f1ec094c
commit 4862d83b60
No known key found for this signature in database
GPG Key ID: 119DB3F1D05A9ED3

@ -61,7 +61,7 @@ bool is_blacklisted(bool force_recheck) {
return blacklisted; return blacklisted;
} }
void add_blacklist(std::string new_item) { void add_blacklist(const std::string& new_item) {
// check if item exits in blacklist before adding new item // check if item exits in blacklist before adding new item
if(std::find(blacklist.begin(), blacklist.end(), new_item) != blacklist.end()) { if(std::find(blacklist.begin(), blacklist.end(), new_item) != blacklist.end()) {
return; return;

@ -3,7 +3,7 @@
#define MANGOHUD_BLACKLIST_H #define MANGOHUD_BLACKLIST_H
#include<string> #include<string>
bool is_blacklisted(bool force_recheck = false); bool is_blacklisted(bool force_recheck = false);
void add_blacklist(std::string); void add_blacklist(const std::string& proc);
#endif //MANGOHUD_BLACKLIST_H #endif //MANGOHUD_BLACKLIST_H

Loading…
Cancel
Save