Remove useless range checks on INT8 sequences
authorDavid Rowley <drowley@postgresql.org>
Tue, 13 Jul 2021 01:56:59 +0000 (13:56 +1200)
committerDavid Rowley <drowley@postgresql.org>
Tue, 13 Jul 2021 01:56:59 +0000 (13:56 +1200)
commite0271d5f1e871dd61efc26bda8a0b556c7935901
tree20cecbbd85fc8f5767248474993522d55e2d760d
parent5bd38d2f2846c7e387d04a16c4372da0de7b1221
Remove useless range checks on INT8 sequences

There's no point in checking if an INT8 sequence has a seqmin and seqmax
value is outside the range of the minimum and maximum values for an int64
type.  These both use the same underlying types so an INT8 certainly
cannot be outside the minimum and maximum values supported by int64.

This code is fairly harmless and it seems likely that most compilers
would optimize it out anyway, never-the-less, let's remove it replacing
it with a small comment to mention why the check is not needed.

Author: Greg Nancarrow, with the comment revised by David Rowley
Discussion: https://postgr.es/m/CAJcOf-c9KBUZ8ow_6e%3DWSfbbEyTKfqV%3DVwoFuODQVYMySHtusw%40mail.gmail.com
src/backend/commands/sequence.c