mirror of
https://github.com/XLabsProject/s1x-client.git
synced 2023-08-02 15:02:12 +02:00
maint(string): use c++20 constexpr (#559)
This commit is contained in:
parent
64178c588b
commit
c6cf4fe4b1
@ -2,10 +2,8 @@
|
||||
#include "memory.hpp"
|
||||
#include <cstdint>
|
||||
|
||||
#ifndef ARRAYSIZE
|
||||
template <class Type, size_t n>
|
||||
size_t ARRAYSIZE(Type (&)[n]) { return n; }
|
||||
#endif
|
||||
constexpr auto ARRAY_COUNT(Type(&)[n]) { return n; }
|
||||
|
||||
namespace utils::string
|
||||
{
|
||||
@ -21,7 +19,7 @@ namespace utils::string
|
||||
|
||||
char* get(const char* format, const va_list ap)
|
||||
{
|
||||
++this->current_buffer_ %= ARRAYSIZE(this->string_pool_);
|
||||
++this->current_buffer_ %= ARRAY_COUNT(this->string_pool_);
|
||||
auto entry = &this->string_pool_[this->current_buffer_];
|
||||
|
||||
if (!entry->size || !entry->buffer)
|
||||
|
Loading…
Reference in New Issue
Block a user