fix over-reliance on compiler optimizer in reserveForInsertImpl
Summary: rehash's max_size check was previously relying on the optimizer to inline and then remove a loop whose value could be determined at compile time. It failed to do this even in some trivial cases, wasting about 10 nanoseconds per rehash. This code moves the max_size check lower (more than 6 entries) and removes the loop entirely. Reviewed By: ot Differential Revision: D8499582 fbshipit-source-id: 8f5c288d3922b094da81ee9261254c729e8cb1b9
Showing
Please register or sign in to comment