Remove unused, but slow code
Merge pull request #4325 from zzet/patch-1

Remove unused but slow code