summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/hyperparser.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2022-06-21 19:36:35 (GMT)
committerGitHub <noreply@github.com>2022-06-21 19:36:35 (GMT)
commit420f0df862cf2290ad6a5e25286925ad197c9ef5 (patch)
tree12237387683de3e6f06fa00da91d92b5de66fd6e /Lib/idlelib/hyperparser.py
parent830513754d081619b2d72db17770627312072fa5 (diff)
downloadcpython-420f0df862cf2290ad6a5e25286925ad197c9ef5.zip
cpython-420f0df862cf2290ad6a5e25286925ad197c9ef5.tar.gz
cpython-420f0df862cf2290ad6a5e25286925ad197c9ef5.tar.bz2
Minor optimization for Fractions.limit_denominator (GH-93730)
When we construct the upper and lower candidates in limit_denominator, the numerator and denominator are already relatively prime (and the denominator positive) by construction, so there's no need to go through the usual normalisation in the constructor. This saves a couple of potentially expensive gcd calls. Suggested by Michael Scott Asato Cuthbert in GH-93477.
Diffstat (limited to 'Lib/idlelib/hyperparser.py')
0 files changed, 0 insertions, 0 deletions