diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-10-25 17:21:07 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-10-25 17:21:07 +0000 |
commit | f29ce5f5f1f0deec646389d5a44bcedb6c543014 (patch) | |
tree | 39eed82e18e8d15063ea472730c729cf5fa49154 /libgo | |
parent | 09367c0d60f551d7d05b6212b649a71636b623ce (diff) | |
download | gcc-f29ce5f5f1f0deec646389d5a44bcedb6c543014.zip gcc-f29ce5f5f1f0deec646389d5a44bcedb6c543014.tar.gz gcc-f29ce5f5f1f0deec646389d5a44bcedb6c543014.tar.bz2 |
Implement predeclared delete function.
From-SVN: r180438
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/runtime/go-map-delete.c | 2 | ||||
-rw-r--r-- | libgo/runtime/map.goc | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libgo/runtime/go-map-delete.c b/libgo/runtime/go-map-delete.c index 9b19ff1..a8f928f 100644 --- a/libgo/runtime/go-map-delete.c +++ b/libgo/runtime/go-map-delete.c @@ -27,7 +27,7 @@ __go_map_delete (struct __go_map *map, const void *key) void **pentry; if (map == NULL) - __go_panic_msg ("assignment to entry in nil map"); + __go_panic_msg ("deletion of entry in nil map"); descriptor = map->__descriptor; diff --git a/libgo/runtime/map.goc b/libgo/runtime/map.goc index e19bc96..da67d49 100644 --- a/libgo/runtime/map.goc +++ b/libgo/runtime/map.goc @@ -45,6 +45,12 @@ func mapassign2(h *Hmap, key *byte, val *byte, p bool) { } } +/* Delete a key from a map. */ + +func mapdelete(h *Hmap, key *byte) { + __go_map_delete(h, key); +} + /* Initialize a range over a map. */ func mapiterinit(h *Hmap, it *hiter) { |