aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xChangeLog6
-rw-r--r--array.c3
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index e713dd48..5efa7213 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2019-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+ * array.c (do_delete): If the array is now empty, reset it to the
+ null implementation to avoid being locked into the backend
+ optimization previously selected.
+
+2019-01-06 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
Remove pointless alength macro/method that uses a needless
function call indirection to access the table_size value.
diff --git a/array.c b/array.c
index d8fbab33..a47660c8 100644
--- a/array.c
+++ b/array.c
@@ -608,6 +608,9 @@ do_delete(NODE *symbol, int nsubs)
(void) assoc_remove(symbol, subs);
DEREF(subs);
+ if (assoc_empty(symbol))
+ /* last element was removed, so reset array type to null */
+ null_array(symbol);
#undef free_subs
}