elm-community / list-extra

Convenience functions for working with List.

Home Page:http://package.elm-lang.org/packages/elm-community/list-extra/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

isInfixOf returns incorrect result when a partial match is found before a complete match

mthiems opened this issue · comments

In version 8.2.2
Small example, shown in repl:

> List.Extra.isInfixOf [1,2] [1,3,1,2]
False : Bool

It should return True .

The problem is that the implementation switches to isPrefixOf as soon as a single item matches.

Good catch! I just opened a PR with a fix.

Thank you @mthiems for reporting. And thank you @pzp1997 for fixing.