aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/numeric.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-09-05 16:20:04 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2020-09-05 16:20:04 -0400
commite0f05cd5ba76a75e2ce3b85ba050e48e857dca00 (patch)
tree5c0ba4e65ab145e66f8c1ccadf026a3f4cbea957 /src/backend/utils/adt/numeric.c
parenta5cc4dab6d1d694f113912a2aca7012a95262f0b (diff)
downloadpostgresql-e0f05cd5ba76a75e2ce3b85ba050e48e857dca00.tar.gz
postgresql-e0f05cd5ba76a75e2ce3b85ba050e48e857dca00.zip
Improve some ancient, crufty code in bootstrap + initdb.
At some point back in the last century, somebody felt that reading all of pg_type twice was cheaper, or at least easier, than using repalloc() to resize the Typ[] array dynamically. That seems like an entirely wacko proposition, so rewrite the code to do it the other way. (To add insult to injury, there were two not-quite-identical copies of said code.) initdb.c's readfile() function had the same disease of preferring to do double the I/O to avoid resizing its output array. Here, we can make things easier by using the just-invented pg_get_line() function to handle reading individual lines without a predetermined notion of how long they are. On my machine, it's difficult to detect any net change in the overall runtime of initdb from these changes; but they should help on slower buildfarm machines (especially since a buildfarm cycle involves a lot of initdb's these days). My attention was drawn to these places by scan-build complaints, but on inspection they needed a lot more work than just suppressing dead stores :-(
Diffstat (limited to 'src/backend/utils/adt/numeric.c')
0 files changed, 0 insertions, 0 deletions