This one weird trie trick just made my program 10% faster in five lines