mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-02 00:15:50 +00:00
Use constexpr to check memo validity
This commit is contained in:
committed by
Nik Bougalis
parent
69bb2be446
commit
e67f90588a
@@ -481,11 +481,10 @@ isMemoOkay(STObject const& st, std::string& reason)
|
|||||||
// The only allowed characters for MemoType and MemoFormat are the
|
// The only allowed characters for MemoType and MemoFormat are the
|
||||||
// characters allowed in URLs per RFC 3986: alphanumerics and the
|
// characters allowed in URLs per RFC 3986: alphanumerics and the
|
||||||
// following symbols: -._~:/?#[]@!$&'()*+,;=%
|
// following symbols: -._~:/?#[]@!$&'()*+,;=%
|
||||||
static std::array<char, 256> const allowedSymbols = [] {
|
static constexpr std::array<char, 256> const allowedSymbols = []() {
|
||||||
std::array<char, 256> a;
|
std::array<char, 256> a{};
|
||||||
a.fill(0);
|
|
||||||
|
|
||||||
std::string symbols(
|
std::string_view symbols(
|
||||||
"0123456789"
|
"0123456789"
|
||||||
"-._~:/?#[]@!$&'()*+,;=%"
|
"-._~:/?#[]@!$&'()*+,;=%"
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
|
|||||||
Reference in New Issue
Block a user