-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix #2517 Don't compare if p_pref is empty #2521
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2521 +/- ##
==========================================
+ Coverage 80.92% 80.94% +0.02%
==========================================
Files 175 175
Lines 26513 26515 +2
==========================================
+ Hits 21455 21462 +7
+ Misses 5058 5053 -5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment
Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
Regarding documentation, it says:
Return the number of occurrences of s2 in s1, 0 otherwise.
So it can remain as-is
But we can also specifically mention an empty s2 will return "length of s1 + 1"
So users avoid unpleasant surprises such as infinite loops.
* don't compare if p_pref is empty * if empty return len+1. add tests * Update src/aggregate/functions/string.c Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * do not init num * fix test * documentation Co-authored-by: Ariel Shtul <ashtul@gmail.com> Co-authored-by: Ariel Shtul <ariel.shtul@redislabs.com> Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> (cherry picked from commit 54113e7)
* don't compare if p_pref is empty * if empty return len+1. add tests * Update src/aggregate/functions/string.c Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * do not init num * fix test * documentation Co-authored-by: Ariel Shtul <ashtul@gmail.com> Co-authored-by: Ariel Shtul <ariel.shtul@redislabs.com> Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> (cherry picked from commit 54113e7)
* don't compare if p_pref is empty * if empty return len+1. add tests * Update src/aggregate/functions/string.c Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> * do not init num * fix test * documentation Co-authored-by: Ariel Shtul <ashtul@gmail.com> Co-authored-by: Ariel Shtul <ariel.shtul@redislabs.com> Co-authored-by: Omer Shadmi <76992134+oshadmi@users.noreply.github.com> (cherry picked from commit 54113e7)
related to #1776