return 0;
if (psc->has_method) {
- /* custom sort function is specified as returning 0 for identical
- * objects: avoid method call overhead.
- */
- if (!memcmp(&ap->val, &bp->val, sizeof(ap->val)))
- goto cmp_same;
argv[0] = ap->val;
argv[1] = bp->val;
res = JS_Call(ctx, psc->method, JS_UNDEFINED, 2, argv);
}
if (cmp != 0)
return cmp;
-cmp_same:
/* make sort stable: compare array offsets */
return (ap->pos > bp->pos) - (ap->pos < bp->pos);