Remove unused variable in non-assert-enabled build
authorTeodor Sigaev <[email protected]>
Sun, 8 Apr 2018 16:30:38 +0000 (19:30 +0300)
committerTeodor Sigaev <[email protected]>
Sun, 8 Apr 2018 16:30:38 +0000 (19:30 +0300)
Use field of structure in Assert directly

Jeff Janes

src/backend/access/common/indextuple.c

index a9c0b620ec0f600c51df7999fd4d50d82108075c..9b3e0a2e6ea29f562e3a0be821fcaa3ae2d0b642 100644 (file)
@@ -459,11 +459,10 @@ index_truncate_tuple(TupleDesc tupleDescriptor, IndexTuple olditup,
        Datum           values[INDEX_MAX_KEYS];
        bool            isnull[INDEX_MAX_KEYS];
        IndexTuple      newitup;
-       int                     indnatts = tupleDescriptor->natts;
 
-       Assert(indnatts <= INDEX_MAX_KEYS);
+       Assert(tupleDescriptor->natts <= INDEX_MAX_KEYS);
        Assert(new_indnatts > 0);
-       Assert(new_indnatts < indnatts);
+       Assert(new_indnatts < tupleDescriptor->natts);
 
        index_deform_tuple(olditup, tupleDescriptor, values, isnull);