Peter Geoghegan <p...@bowt.ie> writes: > The assertions in question are arguably redundant. There are very > similar assertions just a little earlier on, as we initially set up > the array stuff (right before _bt_compare_scankey_args is called). > I'll just remove the "Assert(xform[j].ikey == array->scan_key)" > assertion that Coverity doesn't like, in addition to the > "Assert(!array || array->scan_key == i)" assertion, on the grounds > that they're redundant.
If you're doing that, then surely if (j != (BTEqualStrategyNumber - 1) || !(xform[j].skey->sk_flags & SK_SEARCHARRAY)) { ... } else { Assert(j == (BTEqualStrategyNumber - 1)); Assert(xform[j].skey->sk_flags & SK_SEARCHARRAY); Assert(xform[j].ikey == array->scan_key); Assert(!(cur->sk_flags & SK_SEARCHARRAY)); } those first two Asserts are redundant with the "if" as well. regards, tom lane