mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Use std::size instead of sizeof(a) / sizeof(a[0]) pattern throughout the codebase.
This commit is contained in:
parent
f0f5319b0b
commit
e34f1f504c
33 changed files with 71 additions and 67 deletions
|
|
@ -157,7 +157,7 @@ static const char *token_names[] = {
|
|||
};
|
||||
|
||||
// Avoid desync.
|
||||
static_assert(sizeof(token_names) / sizeof(token_names[0]) == GDScriptTokenizer::Token::TK_MAX, "Amount of token names don't match the amount of token types.");
|
||||
static_assert(std::size(token_names) == GDScriptTokenizer::Token::TK_MAX, "Amount of token names don't match the amount of token types.");
|
||||
|
||||
const char *GDScriptTokenizer::Token::get_name() const {
|
||||
ERR_FAIL_INDEX_V_MSG(type, TK_MAX, "<error>", "Using token type out of the enum.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue