comigor / fuzzy

Fuzzy search in Dart
MIT License
37 stars 20 forks source link

ResultDetails from search Result always have arrayIndex = -1 #18

Closed luistrivelatto closed 3 years ago

luistrivelatto commented 3 years ago

All search results seem to return ResultDetails.arrayIndex = -1. Indeed, looking at fuzzy.dart, it seems there's some sort of mistake in the parameters of the method _analyze: there is a named parameter int arrayIndex = -1 and int index. When _analyze is called, only index is specified. Throughout the body of _analyze, index is used as the source of that search result index. But when the raw result list is updated, arrayIndex is passed to the ResultDetails constructor.

It seems fixing this is just removing the parameters arrayIndex and replacing its uses with index.