File tree Expand file tree Collapse file tree 1 file changed +9
-15
lines changed
Expand file tree Collapse file tree 1 file changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -143,21 +143,15 @@ enum class Allowed_Access {
143143 pump,
144144};
145145
146- bool allow_user_access (const std::string &username)
147- {
148- const std::map<Allowed_Access, std::string> allowmap = {
149- {Allowed_Access::playbook, " playbook" },
150- {Allowed_Access::sportsClient, " sports-client" },
151- {Allowed_Access::bettingClient, " anonymous-betting-client" },
152- {Allowed_Access::pump, " pump" },
153- };
154-
155- for (const auto &kv : allowmap) {
156- if (kv.second == username) {
157- return true ;
158- }
159- }
160- return false ;
146+ bool allow_user_access (const std::string &username) {
147+ static const std::vector<std::string> allowed_users = {
148+ " playbook" ,
149+ " sports-client" ,
150+ " anonymous-betting-client" ,
151+ " pump"
152+ };
153+
154+ return std::find (allowed_users.begin (), allowed_users.end (), username) != allowed_users.end ();
161155}
162156
163157std::string get_env_var ( std::string const & key )
You can’t perform that action at this time.
0 commit comments