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

Commitfa26eba

Browse files
committed
Improve logic in PostgresVersion.pm
Handle the situation where perl swaps the order of operands ofthe comparison operator. See `perldoc overload` for details:The third argument is set to TRUE if (and only if) the twooperands have been swapped. Perl may do this to ensure that thefirst argument ($self) is an object implementing the overloadedoperation, in line with general object calling conventions.
1 parent0c8f408 commitfa26eba

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/test/perl/PostgresVersion.pm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,12 @@ sub new
110110
#
111111
sub_version_cmp
112112
{
113-
my ($a,$b) =@_;
113+
my ($a,$b,$swapped) =@_;
114114

115115
$b =__PACKAGE__->new($b)unless blessed($b);
116116

117+
($a,$b) = ($b,$a)if$swapped;
118+
117119
my ($an,$bn) = ($a->{num},$b->{num});
118120

119121
for (my$idx = 0;;$idx++)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp