From ec25f9b7161c58e941475cbe7b86fc4b13aede25 Mon Sep 17 00:00:00 2001
From: Martin Stjernholm <mast@lysator.liu.se>
Date: Sun, 6 Mar 2011 01:04:44 +0100
Subject: [PATCH] Note that destructed objects sort close to real zeroes.

---
 src/array.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/array.c b/src/array.c
index fbf2c8baa9..2affea7e85 100644
--- a/src/array.c
+++ b/src/array.c
@@ -1012,7 +1012,8 @@ static int obj_or_func_cmp (const struct svalue *a, const struct svalue *b)
     return a->subtype - b->subtype;
 
   /* Destructed objects are considered equal to each other, and
-   * (arbitrarily chosen) greater than others. */
+   * greater than others. That makes them sort close to real zeroes,
+   * which are sorted after objects without compare functions. */
   if (!a->u.object->prog)
     return !b->u.object->prog ? 0 : 1;
   else if (!b->u.object->prog)
-- 
GitLab