lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Wellnhofer <wellnho...@aevum.de>
Subject Re: [lucy-dev] Re: [lucy-commits] svn commit: r1310742 - /lucy/trunk/core/Lucy/Util/SortUtils.c
Date Tue, 10 Apr 2012 16:12:57 GMT
On 10/04/2012 18:03, Marvin Humphrey wrote:
> On Tue, Apr 10, 2012 at 3:21 AM, Nick Wellnhofer<wellnhofer@aevum.de>  wrote:
>> Well, the compare function can be supplied by the user, and I'd prefer that
>> we never segfault on bogus user input.
>
> I didn't think we'd exposed the SortUtils routines to users yet, but fair
> enough.

VA_Sort uses the object's Compare_To function by default, which can be 
overridden by users.

> How about we throw an exception, then?
>
>      if (i == right) {
>          THROW(ERR, "Element failed to test as equal to itself");
>      }

Yes, that's even better than to silently ignore the error.

Nick

Mime
View raw message