mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
This is mostly done for correctness reasons--it is easiest from a logical standpoint to set the realm emojis at the end of the function, since we do not want them to be overwritten by normal emojis. The code worked before this change, but it involved a clunky check to map.has(). There is also probably a very minor performance improvement insofar as N (the number of normal emojis) is typically greater than R (the number of realm emojis), and we eliminate N calls to map.has in return for R calls to map.set. Even if R is quite large, the readability advantages probably far outweigh any performance considerations, since we are using native map calls. Thanks to Austin Riba for this suggestion.
9.9 KiB
9.9 KiB