This reverts commit da79ccca. This optimized the unsuccessful case at the expense of the successful one.