From d645fd63274664c6fced741a0cfae1eb121e13af Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 2 May 2007 22:29:35 +0000 Subject: [PATCH] Empty vectors work much better as the result of sorting an empty array than nil does... --- simgear/nasal/lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simgear/nasal/lib.c b/simgear/nasal/lib.c index 0d7265b7..ff35104c 100644 --- a/simgear/nasal/lib.c +++ b/simgear/nasal/lib.c @@ -514,7 +514,7 @@ static naRef f_sort(naContext c, naRef me, int argc, naRef* args) if(argc != 2 || !naIsVector(args[0]) || !naIsFunc(args[1])) naRuntimeError(c, "bad/missing argument to sort()"); sd.subc = naSubContext(c); - if(!PTR(args[0]).vec->rec) return naNil(); + if(!PTR(args[0]).vec->rec) return naNewVector(c); sd.elems = PTR(args[0]).vec->rec->array; sd.n = PTR(args[0]).vec->rec->size; sd.fn = args[1]; -- 2.39.5