This is just a terrible API to have. Make the scanning a separate method, and document it as an optimization.