Make generic algorithm a little less generic.

R=titzer@chromium.org

Review URL: https://codereview.chromium.org/760493003

Cr-Commit-Position: refs/heads/master@{#25620}