Improve performance of isSuffixOf (#9676)
authorDavid Feuer <David.Feuer@gmail.com>
Mon, 27 Oct 2014 21:12:07 +0000 (22:12 +0100)
committerHerbert Valerio Riedel <hvr@gnu.org>
Mon, 27 Oct 2014 21:12:18 +0000 (22:12 +0100)
commit49b05d6935b6677443a970a45138def66c6f8cee
tree5af9f5a90101f0f5e260c17f9284bdbf90f3d13c
parent0013613dbb4bf969bd70a69ce521239f06624f0f
Improve performance of isSuffixOf (#9676)

The new implementation avoids reversing the "haystack" list, which can be
very expensive.

Reviewed By: ekmett

Differential Revision: https://phabricator.haskell.org/D330
libraries/base/Data/OldList.hs
libraries/base/tests/all.T
libraries/base/tests/isSuffixOf.hs [new file with mode: 0644]
libraries/base/tests/isSuffixOf.stdout [new file with mode: 0644]