antirez / antirez/sds

A question in sdsIncrLen

オープン
#39 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C
スター
5.6k
フォーク
510
PR マージ指標
30日以内にマージされた PR はありません

説明

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';
}

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。