3 ms·
> - non static and non namespaced global variable EMOJIS (should be inside the emojize method or at least in the namespace) The implementation honestly should
by mbel 8y ago
> - non static and non namespaced global variable EMOJIS (should be inside the emojize method or at least in the namespace)
The implementation honestly should be put in .cpp file, not a header. Currently it will define both the gigantic statically-initialized map and a function in each module where it's used. Compared to consequences of this lack of unit tests looks like nit-picking.
And yeah, the logic of the function is easy to follow, so it's definitely not modern C++.
- speps 8y ago> And yeah, the logic of the function is easy to follow, so it's definitely not modern C++. It isn't easy to follow at all, count how many "+1" had to be added just to get indices working right, it's a mine field of off by one errors.
- huhtenberg 8y ago> It isn't easy to follow at all You can't be serious.
- speps 8y agoYou just commented a suggested improvement which proves that it's not easy to follow code. Your suggestion is very good, you still had to process the previous code to understand and it wasn't clear at first.