diff options
author | Ed Tanous <edtanous@google.com> | 2023-05-11 19:51:51 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-05-26 00:09:16 +0300 |
commit | 4b242749b31b16c663fe2e95ad7dbc6a2f3ca973 (patch) | |
tree | 6d6ceaab871c6f2101e874d7f980cdc3d68530a9 /include/dbus_monitor.hpp | |
parent | 283860f5fb0e685d6c5e8c149451f0d1be0b9103 (diff) | |
download | bmcweb-4b242749b31b16c663fe2e95ad7dbc6a2f3ca973.tar.xz |
Make all std::regex instances static
Per [1] we really shouldn't be using regex. In the cases we do, it's a
HUUUUUGE performance benefit to be compiling the regex ONCE.
The only downside is a slight increase in memory usage.
[1]: https://github.com/openbmc/bmcweb/issues/176
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I8644b8a07810349fb60bfa0258a13e815912a38e
Diffstat (limited to 'include/dbus_monitor.hpp')
-rw-r--r-- | include/dbus_monitor.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/dbus_monitor.hpp b/include/dbus_monitor.hpp index 46ef25e00e..4ecc4367d9 100644 --- a/include/dbus_monitor.hpp +++ b/include/dbus_monitor.hpp @@ -173,8 +173,8 @@ inline void requestRoutes(App& app) // These regexes derived on the rules here: // https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names - std::regex validPath("^/([A-Za-z0-9_]+/?)*$"); - std::regex validInterface( + static std::regex validPath("^/([A-Za-z0-9_]+/?)*$"); + static std::regex validInterface( "^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)+$"); for (const auto& thisPath : *paths) |