Perform fewer dict lookups - tiny microoptimization

This is a tiny micro-optimization, feel free to apply or ignore or whatever :)