* Copying an already immutable hashtable, and requesting an
immutable table returns the same table without copying.
This commit is contained in:
parent
007f05989b
commit
de369b3497
|
@ -393,11 +393,15 @@
|
|||
(case-lambda
|
||||
[(h)
|
||||
(if (hasht? h)
|
||||
(hasht-copy h #f)
|
||||
(if (hasht-mutable? h)
|
||||
(hasht-copy h #f)
|
||||
h)
|
||||
(error 'hashtable-copy "not a hash table" h))]
|
||||
[(h mutable?)
|
||||
(if (hasht? h)
|
||||
(hasht-copy h (and mutable? #t))
|
||||
(if (or mutable? (hasht-mutable? h))
|
||||
(hasht-copy h (and mutable? #t))
|
||||
h)
|
||||
(error 'hashtable-copy "not a hash table" h))]))
|
||||
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue