0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-16 23:10:54 +01:00

ircd: Rename tokens_count() to token_count().

This commit is contained in:
Jason Volk 2017-10-11 17:56:15 -07:00
parent d3f6ed0320
commit 4f0de4915d
3 changed files with 9 additions and 9 deletions

View file

@ -67,7 +67,7 @@ ircd::util::params::at(const size_t &i,
const T &def) const T &def)
const try const try
{ {
return tokens_count(in, sep) > i? at<T>(i) : def; return token_count(in, sep) > i? at<T>(i) : def;
} }
catch(const bad_lex_cast &e) catch(const bad_lex_cast &e)
{ {
@ -101,7 +101,7 @@ inline ircd::string_view
ircd::util::params::operator[](const size_t &i) ircd::util::params::operator[](const size_t &i)
const const
{ {
return tokens_count(in, sep) > i? token(in, sep, i) : string_view{}; return token_count(in, sep) > i? token(in, sep, i) : string_view{};
} }
inline const char * inline const char *

View file

@ -83,8 +83,8 @@ namespace ircd
C<T, Comp, A> tokens(const string_view &str, const sep &); C<T, Comp, A> tokens(const string_view &str, const sep &);
// Convenience to get individual tokens // Convenience to get individual tokens
size_t tokens_count(const string_view &str, const char &sep); size_t token_count(const string_view &str, const char &sep);
size_t tokens_count(const string_view &str, const char *const &sep); size_t token_count(const string_view &str, const char *const &sep);
string_view token(const string_view &str, const char &sep, const size_t &at); string_view token(const string_view &str, const char &sep, const size_t &at);
string_view token(const string_view &str, const char *const &sep, const size_t &at); string_view token(const string_view &str, const char *const &sep, const size_t &at);
string_view token_last(const string_view &str, const char &sep); string_view token_last(const string_view &str, const char &sep);

View file

@ -138,16 +138,16 @@ ircd::token(const string_view &str,
} }
size_t size_t
ircd::tokens_count(const string_view &str, ircd::token_count(const string_view &str,
const char &sep) const char &sep)
{ {
const char ssep[2] { sep, '\0' }; const char ssep[2] { sep, '\0' };
return tokens_count(str, ssep); return token_count(str, ssep);
} }
size_t size_t
ircd::tokens_count(const string_view &str, ircd::token_count(const string_view &str,
const char *const &sep) const char *const &sep)
{ {
using type = string_view; using type = string_view;
using iter = typename type::const_iterator; using iter = typename type::const_iterator;