Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Fatal error: Can't form Range with upperBound < lowerBound #36

Open
el-quick opened this issue Dec 17, 2019 · 0 comments
Open

Fatal error: Can't form Range with upperBound < lowerBound #36

el-quick opened this issue Dec 17, 2019 · 0 comments

Comments

@el-quick
Copy link

I am trying use asynchronous version on this way:

fuse.search(searchText, in: Keyword.searchables, completion: { results in
    ...
})

And I am getting this problem:

Captura de Pantalla 2019-12-17 a la(s) 09 32 21

To take in account: Keyword.searchables is an array of string with near of 3000 items in it.

By the moment I solved it on this way:

for (index, item) in chunk.enumerated() {
    if let result = self.search(pattern, in: item) {
        if result.ranges.allSatisfy({ $0.upperBound > $0.lowerBound }) {
            items.append((index, result.score, result.ranges))
        }
    }
}

I know that's not the best way, and functionality comes affected, but it's working for me now.

Thanks in advance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant