Use std::size instead of sizeof(a) / sizeof(a[0]) pattern throughout the codebase.
This commit is contained in:
@ -429,7 +429,7 @@ class CharBuffer {
|
||||
public:
|
||||
_FORCE_INLINE_ CharBuffer() :
|
||||
buffer(stack_buffer),
|
||||
capacity(sizeof(stack_buffer) / sizeof(char)) {
|
||||
capacity(std::size(stack_buffer)) {
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ void push_back(char c) {
|
||||
|
||||
@ -46,7 +46,7 @@ String ResourceUID::get_cache_file() {
|
||||
}
|
||||
|
||||
static constexpr uint8_t uuid_characters[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', '0', '1', '2', '3', '4', '5', '6', '7', '8' };
|
||||
static constexpr uint32_t uuid_characters_element_count = (sizeof(uuid_characters) / sizeof(*uuid_characters));
|
||||
static constexpr uint32_t uuid_characters_element_count = std::size(uuid_characters);
|
||||
static constexpr uint8_t max_uuid_number_length = 13; // Max 0x7FFFFFFFFFFFFFFF (uid://d4n4ub6itg400) size is 13 characters.
|
||||
|
||||
String ResourceUID::id_to_text(ID p_id) const {
|
||||
|
||||
Reference in New Issue
Block a user