Fix performance regression
Use `is`
Merge pull request #3234 from mdboom/unit/fix-performance-regression

Fix performance regression getting format class for Unit