You might be able to safe a tiny bit of time. Your `O` stuff is nonsense anyway, it is all `O(n)` the constant is probably larger, but for that you should do timing and not hand waiving arguments probably.