Re: Fix for seg picksplit function - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Fix for seg picksplit function
Date
Msg-id 1289394705-sup-7337@alvh.no-ip.org
Whole thread Raw
In response to Re: Fix for seg picksplit function  (Yeb Havinga <yebhavinga@gmail.com>)
Responses Re: Fix for seg picksplit function
Re: Fix for seg picksplit function
List pgsql-hackers
Hmm, the second for loop in gseg_picksplit uses "i < maxoff" whereas the
other one uses <=.  The first is probably correct; if the second is also
correct it merits a comment on the discrepancy (To be honest, I'd get
rid of the "-1" in computing maxoff and use < in both places, given that
offsets are 1-indexed).  Also, the second one is using i++ to increment;
probably should be OffsetNumberNext just to stay consistent with the
rest of the code.

The assignment to *left and *right at the end of the routine seem pretty
useless (not to mention the comment talking about a routine that doesn't
exist anywhere).

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Viktor Valy
Date:
Subject: Re: TODO Alter Table Rename Constraint
Next
From: "Kevin Grittner"
Date:
Subject: Re: multi-platform, multi-locale regression tests