comigor / fuzzy

Fuzzy search in Dart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails if the pattern is of length 0

zacps opened this issue · comments

The problematic line is here.

final mask = 1 << (patternLen <= 31 ? patternLen - 1 : 30);

If patternLen = 0 then (patternLen <= 31 ? patternLen - 1 : 30)=-1 which promptly fails the shift.

Hey again @zacps, thanks for pointing this!

Could you open a PR fixing this issue? I'd greatly appreaciate it!