Skip to content

Commit

Permalink
net/djb/NetstringInput: use CheckChars()
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Nov 27, 2024
1 parent 16e1e4c commit 2824ed0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/net/djb/NetstringInput.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "system/Error.hxx"
#include "util/CharUtil.hxx"
#include "util/Compiler.h"
#include "util/StringVerify.hxx"

#include <fmt/core.h>

Expand All @@ -18,14 +19,10 @@
#include <errno.h>

[[gnu::pure]]
static bool
static constexpr bool
OnlyDigits(std::string_view s) noexcept
{
for (char ch : s)
if (!IsDigitASCII(ch))
return false;

return true;
return CheckChars(s, IsDigitASCII);
}

inline NetstringInput::Result
Expand Down

0 comments on commit 2824ed0

Please sign in to comment.