Add static assert for array size.
GitOrigin-RevId: 1f044bd3c05346316d27c7ae0462a2b0d575168a
This commit is contained in:
parent
3305ca5689
commit
b575ed9a98
@ -26,6 +26,7 @@ namespace td {
|
||||
|
||||
int MessageEntity::get_type_priority(Type type) {
|
||||
static const int types[] = {50, 50, 50, 50, 50, 90, 91, 20, 11, 10, 49, 49, 50, 50, 92, 93, 0, 50};
|
||||
static_assert(sizeof(types) / sizeof(types[0]) == static_cast<size_t>(MessageEntity::Type::Size), "");
|
||||
return types[static_cast<int32>(type)];
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,8 @@ class MessageEntity {
|
||||
Underline,
|
||||
Strikethrough,
|
||||
BlockQuote,
|
||||
BankCardNumber
|
||||
BankCardNumber,
|
||||
Size
|
||||
};
|
||||
Type type;
|
||||
int32 offset;
|
||||
|
Loading…
Reference in New Issue
Block a user