This reverts commit da79ccca1d. This optimized the unsuccessful case at the expense of the successful one. Backport of 293fd5da5b from master
da79ccca1d
293fd5da5b