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

Commit07f6c02

Browse files
committed
tskey_cmp() should use timestamp_cmp() instead of doing its own
interval arithmetic. From Teodor Sigaev.
1 parent839c792 commit07f6c02

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

‎contrib/btree_gist/btree_gist.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -447,21 +447,13 @@ gts_binary_union(Datum *r1, char *r2)
447447

448448
staticint
449449
tskey_cmp(constvoid*a,constvoid*b) {
450-
Interval*intr;
451-
floatresult;
452-
453-
intr=DatumGetIntervalP(DirectFunctionCall2(
454-
timestamp_mi,
455-
TimestampGetDatum( ((TSKEY*)(((RIX*)a)->r))->lower ),
456-
TimestampGetDatum( ((TSKEY*)(((RIX*)b)->r))->lower )) );
457-
458-
/* see interval_larger */
459-
result=intr->time+intr->month* (30.0*86400);
460-
pfree(intr );
461-
if (result==0.0 )
462-
return0;
463-
else
464-
return (result>0 ) ?1 :0;
450+
returnDatumGetInt32(
451+
DirectFunctionCall2(
452+
timestamp_cmp,
453+
TimestampGetDatum( ((TSKEY*)(((RIX*)a)->r))->lower ),
454+
TimestampGetDatum( ((TSKEY*)(((RIX*)b)->r))->lower )
455+
)
456+
);
465457
}
466458

467459
/**************************************************

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp