We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re: GH-3
The text was updated successfully, but these errors were encountered:
How about using the existing emojiAliases dictionary and constructing the reverse, something like:
emojiAliases
+ (NSDictionary *)reverseEmojiAliases { static NSDictionary *_reverseEmojiAliases; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ NSMutableDictionary *map = [[NSMutableDictionary alloc] init]; NSSet* uniqueEmoji = [NSSet setWithArray:[[self emojiAliases] allValues]]; [uniqueEmoji enumerateObjectsUsingBlock:^(NSString *emoji, BOOL *stop) { NSString* code = [[[self emojiAliases] allKeysForObject:emoji] firstObject]; map[emoji] = code; }]; _reverseEmojiAliases = [[NSDictionary alloc] initWithDictionary:map]; }); return _reverseEmojiAliases; }
Sorry, something went wrong.
How about this?
-(NSDictionary *)reverseEmojiAliases { NSMutableDictionary *_revEmojiAliases = [NSMutableDictionary new]; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ for (NSString *key in [EMOJI_HASH allKeys]) { _revEmojiAliases[EMOJI_HASH[key]] = key; } }); return _revEmojiAliases; }
No branches or pull requests
Re: GH-3
The text was updated successfully, but these errors were encountered: