requesthandler: Use unordered_map for request table

Shaves like 0.0005ms off of request time, but still worth noting.
This commit is contained in:
tt2468 2021-12-31 14:19:19 -08:00
parent 02bcc0ac1b
commit e451a8d6b0
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include "RequestHandler.h" #include "RequestHandler.h"
const std::map<std::string, RequestMethodHandler> RequestHandler::_handlerMap const std::unordered_map<std::string, RequestMethodHandler> RequestHandler::_handlerMap
{ {
// General // General
{"GetVersion", &RequestHandler::GetVersion}, {"GetVersion", &RequestHandler::GetVersion},

View File

@ -19,7 +19,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#pragma once #pragma once
#include <map> #include <unordered_map>
#include <obs.hpp> #include <obs.hpp>
#include <obs-frontend-api.h> #include <obs-frontend-api.h>
@ -165,5 +165,5 @@ class RequestHandler {
RequestResult OpenInputInteractDialog(const Request&); RequestResult OpenInputInteractDialog(const Request&);
SessionPtr _session; SessionPtr _session;
static const std::map<std::string, RequestMethodHandler> _handlerMap; static const std::unordered_map<std::string, RequestMethodHandler> _handlerMap;
}; };