diff options
author | antirez <antirez@gmail.com> | 2020-04-01 17:14:36 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2020-04-01 17:14:40 +0200 |
commit | c9c03c3ee60b6a7a4918d4b2bbf40cfd21fcd284 (patch) | |
tree | 4148c0c4ecc61e9ebd99d6716933d27fc612ecaa /src | |
parent | b3400559be53ff77f7196c99d791d62d298875e9 (diff) | |
download | redis-c9c03c3ee60b6a7a4918d4b2bbf40cfd21fcd284.tar.gz |
LCS: fix emission of last range starting at index 0.
Diffstat (limited to 'src')
-rw-r--r-- | src/t_string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/t_string.c b/src/t_string.c index 6c096a539..caccd11f1 100644 --- a/src/t_string.c +++ b/src/t_string.c @@ -595,7 +595,6 @@ void lcsCommand(client *c) { arange_end = i-1; brange_start = j-1; brange_end = j-1; - if (i == 0 || j == 0) emit_range = 1; } else { /* Let's see if we can extend the range backward since * it is contiguous. */ @@ -606,6 +605,7 @@ void lcsCommand(client *c) { emit_range = 1; } } + if (arange_start == 0 || brange_start == 0) emit_range = 1; /* Emit the current range if needed. */ if (emit_range) { |