summaryrefslogtreecommitdiff
path: root/src/map.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-01-17 15:59:53 -0500
committerAdrian Thurston <thurston@complang.org>2015-01-17 16:01:12 -0500
commit8e87d8e820bee8f4a957bdc00b33b7966f542189 (patch)
treee0deefc2ea379e7c4a788d90c64f8e6ea8b1629d /src/map.c
parentf63f06c1296da21bdddbbb7cca8f8e4cf62efca1 (diff)
downloadcolm-8e87d8e820bee8f4a957bdc00b33b7966f542189.tar.gz
only undo the insert if the insert was successful
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map.c b/src/map.c
index 2d617e21..6c34ab58 100644
--- a/src/map.c
+++ b/src/map.c
@@ -616,9 +616,9 @@ MapEl *mapInsertKey( Program *prg, Map *map, Tree *key, MapEl **lastFound )
}
}
-void colm_map_insert( Program *prg, Map *map, MapEl *mapEl )
+MapEl *colm_map_insert( Program *prg, Map *map, MapEl *mapEl )
{
- mapInsertEl( prg, map, mapEl, 0 );
+ return mapInsertEl( prg, map, mapEl, 0 );
}
void colm_map_detach( Program *prg, Map *map, MapEl *mapEl )