mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
copy out keys also in HashMap.copy_keys (#1569)
* copy out keys also in HashMap.copy_keys * test for copying keys out
This commit is contained in:
@@ -313,7 +313,11 @@ fn Key[] HashMap.copy_keys(&map, Allocator allocator = allocator::heap())
|
||||
{
|
||||
while (entry)
|
||||
{
|
||||
list[index++] = entry.key;
|
||||
$if COPY_KEYS:
|
||||
list[index++] = entry.key.copy(allocator);
|
||||
$else
|
||||
list[index++] = entry.key;
|
||||
$endif
|
||||
entry = entry.next;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user