mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #102419 from Ivorforce/std-size
Use `std::size` instead of `sizeof(a) / sizeof(a[0])` pattern throughout the codebase.
This commit is contained in:
commit
c937b6d180
33 changed files with 71 additions and 67 deletions
|
@ -4131,7 +4131,7 @@ GDScriptParser::ParseRule *GDScriptParser::get_rule(GDScriptTokenizer::Token::Ty
|
|||
};
|
||||
/* clang-format on */
|
||||
// Avoid desync.
|
||||
static_assert(sizeof(rules) / sizeof(rules[0]) == GDScriptTokenizer::Token::TK_MAX, "Amount of parse rules don't match the amount of token types.");
|
||||
static_assert(std::size(rules) == GDScriptTokenizer::Token::TK_MAX, "Amount of parse rules don't match the amount of token types.");
|
||||
|
||||
// Let's assume this is never invalid, since nothing generates a TK_MAX.
|
||||
return &rules[p_token_type];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue