if (m > m) return -1; Is one of the m a typo? Not a bottleneck though.
if (m > m) return -1;
Is one of the m a typo?
Not a bottleneck though.