Rightpoint / BonMot

Beautiful, easy attributed strings in Swift
MIT License
3.54k stars 197 forks source link

Return current BONFont, if has no features #313

Closed muukii closed 6 years ago

muukii commented 6 years ago

I found overhead in creating a font. I think the creating font should return self if it has no features. So, StringStyle will be faster.

What do you think?

ZevEisenberg commented 6 years ago

@muukii cool, thanks for this contribution! I ran a couple of quick tests, and it does indeed seem to be faster. I wish there were a convenient way to add those performance benchmarks to the tests, so that we don't regress, but for now I'm just happy to have this improvement 🎉