Make some arrays const.

GitOrigin-RevId: 6c7f0cf45fdc6736defb1559674242e1f1f29c91
This commit is contained in:
levlam 2018-07-03 02:28:28 +03:00
parent 4ebc21fe3d
commit de7160f890
2 changed files with 27 additions and 27 deletions

View File

@ -4198,15 +4198,15 @@ vector<string> StickersManager::get_sticker_emojis(const tl_object_ptr<td_api::I
}
string StickersManager::remove_emoji_modifiers(string emoji) {
static Slice modifiers[] = {u8"\uFE0E" /* variation selector-15 */,
u8"\uFE0F" /* variation selector-16 */,
u8"\u200D\u2640" /* zero width joiner + female sign */,
u8"\u200D\u2642" /* zero width joiner + male sign */,
u8"\U0001F3FB" /* emoji modifier fitzpatrick type-1-2 */,
u8"\U0001F3FC" /* emoji modifier fitzpatrick type-3 */,
u8"\U0001F3FD" /* emoji modifier fitzpatrick type-4 */,
u8"\U0001F3FE" /* emoji modifier fitzpatrick type-5 */,
u8"\U0001F3FF" /* emoji modifier fitzpatrick type-6 */};
static const Slice modifiers[] = {u8"\uFE0E" /* variation selector-15 */,
u8"\uFE0F" /* variation selector-16 */,
u8"\u200D\u2640" /* zero width joiner + female sign */,
u8"\u200D\u2642" /* zero width joiner + male sign */,
u8"\U0001F3FB" /* emoji modifier fitzpatrick type-1-2 */,
u8"\U0001F3FC" /* emoji modifier fitzpatrick type-3 */,
u8"\U0001F3FD" /* emoji modifier fitzpatrick type-4 */,
u8"\U0001F3FE" /* emoji modifier fitzpatrick type-5 */,
u8"\U0001F3FF" /* emoji modifier fitzpatrick type-6 */};
bool found = true;
while (found) {
found = false;

View File

@ -118,24 +118,24 @@ static void reactivate_readline() {
}
static char *command_generator(const char *text, int state) {
static vector<CSlice> commands{"GetContacts",
"GetChats",
"GetHistory",
"SetVerbosity",
"SendVideo",
"SearchDocument",
"GetChatMember",
"GetSupergroupAdministrators",
"GetSupergroupBanned",
"GetSupergroupMembers",
"GetFile",
"DownloadFile",
"CancelDownloadFile",
"ImportContacts",
"RemoveContacts",
"DumpNetQueries",
"CreateSecretChat",
"CreateNewSecretChat"};
static const vector<CSlice> commands{"GetContacts",
"GetChats",
"GetHistory",
"SetVerbosity",
"SendVideo",
"SearchDocument",
"GetChatMember",
"GetSupergroupAdministrators",
"GetSupergroupBanned",
"GetSupergroupMembers",
"GetFile",
"DownloadFile",
"CancelDownloadFile",
"ImportContacts",
"RemoveContacts",
"DumpNetQueries",
"CreateSecretChat",
"CreateNewSecretChat"};
static size_t cmd_i;
if (state == 0) {
cmd_i = 0;