A question in sdsIncrLen
Open
- Dominant language
- C
- Stars
- 5.6k
- Forks
- 510
- PR merge metrics
- No merged PRs in 30d
Description
In the function sdsIncrLen, I think the statement "assert(sh->free >= 0) " is redundant, because "assert(sh->free >= incr)" makes sure this situation would not happen.
void sdsIncrLen(sds s, int incr) {
struct sdshdr _sh = (void_)(s - sizeof *sh);
assert(sh->free >= incr);
sh->len += incr;
sh->free -= incr;
assert(sh->free >= 0);
s[sh->len] = '\0';
}
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.