es5-ext
es5-ext copied to clipboard
Try to optimise toPosInt
According to https://github.com/medikoo/es6-iterator/pull/2 it may slow down hot paths.
There's either issue in unconditional max call or internals of toInteger.
As a side note toPosInt will be renamed to toNatural
As far as I played with it - it's rather problem with toInteger in general (I tried replacing max with custom ternary operator, but speed difference was negligible.