]> granicus.if.org Git - postgresql/commit
Factor out the common subexpression month_remainder * DAYS_PER_MONTH
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 25 Aug 2005 05:01:43 +0000 (05:01 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 25 Aug 2005 05:01:43 +0000 (05:01 +0000)
commit2613b7478573c7fc833c90ff8aa731a15d32aaaf
tree1ee03db46747fc09c1e319e9f75d95fbee4412a6
parentca4cf09232ae37c5cdaed23236dc37f37bedff55
Factor out the common subexpression month_remainder * DAYS_PER_MONTH
in interval_mul and interval_div.  This avoids an optimization bug
in A Certain Company's compiler (and given their explanation, I wouldn't
be surprised if other compilers blow it too).  Besides the code seems
more clear this way --- in the original formulation, you had to mentally
recognize the common subexpression in order to understand what was going
on.
src/backend/utils/adt/timestamp.c