Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteee50a8

Browse files
committed
PL/Python: Simplify PLyLong_FromInt64
We don't actually need two code paths, one for 32 bits and one for 64bits. Since the existing code already assumed that "long long" isavailable, we can just use PyLong_FromLongLong() for 64 bits as well.In Python 2.5 and later, PyLong_FromLong() and PyLong_FromLongLong() usethe same code, so there will be no difference for 64-bit platforms. InPython 2.4, the code is different, but performance testing showed nonoticeable difference in PL/Python, and that Python version is ancientanyway.Discussion:https://www.postgresql.org/message-id/0a02203c-e157-55b2-464e-6087066a1849@2ndquadrant.com
1 parent2f17844 commiteee50a8

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

‎src/pl/plpython/plpy_typeio.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -618,11 +618,7 @@ PLyInt_FromInt32(PLyDatumToOb *arg, Datum d)
618618
staticPyObject*
619619
PLyLong_FromInt64(PLyDatumToOb*arg,Datumd)
620620
{
621-
/* on 32 bit platforms "long" may be too small */
622-
if (sizeof(int64)>sizeof(long))
623-
returnPyLong_FromLongLong(DatumGetInt64(d));
624-
else
625-
returnPyLong_FromLong(DatumGetInt64(d));
621+
returnPyLong_FromLongLong(DatumGetInt64(d));
626622
}
627623

628624
staticPyObject*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp