Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Double the speed for Utils.build_nested_query for handling large arrays
The branch to take the prefix will be taken at most one time when inside the loop, and this code is only called if the array is non-empty, meaning it is called at least one time. So it's safe to move it outside the loop. While here, change the probably wrong regexp use with $ to a String#end_with? call. I tried using the buffer-based approach used for build_multipart in build_nested_query, but it did not provide a measurable speedup, and made the method measurably slower for some inputs.
- Loading branch information