aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorDean Rasheed <dean.a.rasheed@gmail.com>2022-02-27 10:41:12 +0000
committerDean Rasheed <dean.a.rasheed@gmail.com>2022-02-27 10:41:12 +0000
commitd996d648f333b04ae3da3c5853120f6f37601fb2 (patch)
treebf1cd477a40fb26040c7b08b54fad4f9db566a0e /src/backend/tcop/postgres.c
parente3d41d08a17549fdc60a8b9450c0511c11d666d7 (diff)
downloadpostgresql-d996d648f333b04ae3da3c5853120f6f37601fb2.tar.gz
postgresql-d996d648f333b04ae3da3c5853120f6f37601fb2.zip
Simplify the inner loop of numeric division in div_var().
In the standard numeric division algorithm, the inner loop multiplies the divisor by the next quotient digit and subtracts that from the working dividend. As suggested by the original code comment, the separate "carry" and "borrow" variables (from the multiplication and subtraction steps respectively) can be folded together into a single variable. Doing so significantly improves performance, as well as simplifying the code. Dean Rasheed, reviewed by Tom Lane. Discussion: https://postgr.es/m/CAEZATCVwsBi-ND-t82Cuuh1=8ee6jdOpzsmGN+CUZB6yjLg9jw@mail.gmail.com
Diffstat (limited to 'src/backend/tcop/postgres.c')
0 files changed, 0 insertions, 0 deletions