Skip to content

Commit

Permalink
Merge pull request #29 from comigor/digit-master
Browse files Browse the repository at this point in the history
fix: Range error when using limit argument to fuse.search
  • Loading branch information
comigor committed Oct 17, 2023
2 parents 83baf8c + 45f60ae commit f7524df
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# CHANGELOG

## 0.5.1
- Range error when using limit argument to fuse.search, closes #25. [Original PR](https://github.com/comigor/fuzzy/pull/26).

## 0.5.0
- Dart 3 support added.

Expand Down
2 changes: 1 addition & 1 deletion lib/fuzzy.dart
Expand Up @@ -55,7 +55,7 @@ class Fuzzy<T> {
_sort(resultsAndWeights.results);
}

if (limit > 0) {
if (limit > 0 && resultsAndWeights.results.length > limit) {
return resultsAndWeights.results.sublist(0, limit);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,5 +1,5 @@
name: fuzzy
version: 0.5.0
version: 0.5.1

description: >
Fuzzy search in Dart. Initially a code conversion, subset of Fuse.js.
Expand Down

0 comments on commit f7524df

Please sign in to comment.