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

String Comparison Crash #18

Closed
saru2020 opened this issue Jan 7, 2019 · 2 comments
Closed

String Comparison Crash #18

saru2020 opened this issue Jan 7, 2019 · 2 comments
Labels

Comments

@saru2020
Copy link

saru2020 commented Jan 7, 2019

Hi,

Is there any reason why the below line of string comparison would lead to a crash?

    let result = fuse.search("Rancheras 2016 Borracho de Amor  Por Tu Maldito Amor  Hermoso Carino  Se Va Muriendo Mi Alma  Por un Amor", in: "Borracho De Amor")

fuse - comparison

fuse - crash

Any help would be appreciated. Thanks!

@krisk
Copy link
Owner

krisk commented Jan 15, 2019

You have the arguments the other way around.

Your pattern is the first argument, and the string you are searching in is your second.

See here for reference.

@krisk krisk added the question label Jan 15, 2019
@krisk krisk closed this as completed Feb 20, 2019
@adamcichy
Copy link

@krisk The same bug happens randomly for me when the pattern is longer than the string (which happens often in my case but works fine most of the time). Should I prevent such usecase in my code? O is there going to be a release that will handle this case?

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

No branches or pull requests

3 participants