mirror of
https://github.com/bkaradzic/bx.git
synced 2026-07-01 03:28:50 +00:00
StringView constexpr. (#351)
This commit is contained in:
committed by
GitHub
parent
0e221f9844
commit
808aa150f8
@@ -165,7 +165,7 @@ namespace bx
|
||||
|
||||
typedef char (*CharFn)(char _ch);
|
||||
|
||||
inline char toNoop(char _ch)
|
||||
inline constexpr char toNoop(char _ch)
|
||||
{
|
||||
return _ch;
|
||||
}
|
||||
@@ -290,18 +290,6 @@ namespace bx
|
||||
);
|
||||
}
|
||||
|
||||
int32_t strLen(const char* _str, int32_t _max)
|
||||
{
|
||||
if (NULL == _str)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char* ptr = _str;
|
||||
for (; 0 < _max && *ptr != '\0'; ++ptr, --_max) {};
|
||||
return int32_t(ptr - _str);
|
||||
}
|
||||
|
||||
inline int32_t strCopy(char* _dst, int32_t _dstSize, const char* _src, int32_t _num)
|
||||
{
|
||||
BX_ASSERT(NULL != _dst, "_dst can't be NULL!");
|
||||
|
||||
Reference in New Issue
Block a user