remove superfluous else block (#7620)

The else block would be executed when newlen == 0 and in the case memmove won't be called, so there's no need to set start.
This commit is contained in:
xuannianz 2020-08-08 05:19:18 +08:00 committed by GitHub
parent e966264188
commit b118502a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -756,8 +756,6 @@ void sdsrange(sds s, ssize_t start, ssize_t end) {
end = len-1;
newlen = (start > end) ? 0 : (end-start)+1;
}
} else {
start = 0;
}
if (start && newlen) memmove(s, s+start, newlen);
s[newlen] = 0;