more portable way of force inlining

This commit is contained in:
EntireTwix 2021-08-10 19:57:44 -07:00
parent 2823a6fe3f
commit ae7f3e7cfa
2 changed files with 2 additions and 2 deletions

View file

@ -1,6 +1,6 @@
#include "json_filter.h"
__attribute__((always_inline)) inline bool Contains(std::string_view str, const std::string &val)
constexpr bool Contains(std::string_view str, const std::string &val)
{
return str.find(val) != std::string::npos;
}

View file

@ -1,6 +1,6 @@
#include "user_filter.h"
inline bool ValidUsername(const std::string &name) noexcept
constexpr bool ValidUsername(const std::string &name) noexcept
{
if (name.size() < min_name_size || name.size() > max_name_size)
{