RE: IndexedDB: ordering sense of IDBFactory.cmp?

On Monday, October 03, 2011 10:04 AM, Jonas Sicking wrote:
> On Mon, Oct 3, 2011 at 9:30 AM, Joshua Bell <jsbell@chromium.org> wrote:
> > As we're implementing IDBFactory.cmp in WebKit we noticed that the
> > ordering sense is reversed compared to C's strcmp/memcmp, Perl's
> > cmp/<=> operators, etc.
> > As currently spec'd, IDBFactory.cmp(first, second) returns 1 if first
> > < second C's memcmp/strcmp(first, second) return -1 if first < second
> > Perl's (first cmp second) and (first <=> second) operators return -1
> > if first < second Java's first.compareTo(second) returns < 0 if first
> > < second .NET's String.Compare(first, second) returns < 0 if first <
> > second We're wondering if this will be a usability issue with the API,
> > if there's a good justification for this seemingly inverted ordering,
> > and if it's not too late to reverse this in the spec.
> 
> I don't recall any particular reason for the current order. I suspect it was
> simply a mistake.
> 
> I'm all for reversing order.
> 
> / Jonas
> 

Good catch!  This makes sense to us too.

Israel

Received on Monday, 10 October 2011 18:07:51 UTC