summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-04-21 21:31:36 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-04-21 21:31:36 (GMT)
commit9198a2a40a36d6c46b5d4d1e6371c8139f5002e9 (patch)
tree5366c8e6111962ddf0fc8068ee651b34d3d838d9
parent97e45523cfac9f726b851b40450824e60868f2a2 (diff)
downloadtcl-9198a2a40a36d6c46b5d4d1e6371c8139f5002e9.zip
tcl-9198a2a40a36d6c46b5d4d1e6371c8139f5002e9.tar.gz
tcl-9198a2a40a36d6c46b5d4d1e6371c8139f5002e9.tar.bz2
Added note about a safe and useful mode of update to a hash being iterated over.
-rw-r--r--ChangeLog5
-rw-r--r--doc/Hash.37
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index bbc2296..9ccc373 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2004-04-21 Donal K. Fellows <donal.k.fellows@man.ac.uk>
+ * doc/Hash.3: Added note to Tcl_{First,Next}HashEntry docs that
+ deleting the element they return is supported (and is in fact the
+ only safe update you can do to the structure of a hashtable while
+ an iteration is going over it.)
+
* doc/bgerror.n: Added example from David Welton. [Patch 939473]
* doc/after.n: Added examples from David Welton. [Patch 938820]
diff --git a/doc/Hash.3 b/doc/Hash.3
index 1067db5..32b40ec 100644
--- a/doc/Hash.3
+++ b/doc/Hash.3
@@ -5,7 +5,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: Hash.3,v 1.12 2003/11/14 23:21:02 dkf Exp $
+'\" RCS: @(#) $Id: Hash.3,v 1.13 2004/04/21 21:33:38 dkf Exp $
'\"
.so man.macros
.TH Tcl_Hash 3 "" Tcl "Tcl Library Procedures"
@@ -210,8 +210,9 @@ A call to \fBTcl_FirstHashEntry\fR followed by calls to
\fBTcl_NextHashEntry\fR will return each of the entries in
the table exactly once, in an arbitrary order.
It is unadvisable to modify the structure of the table, e.g.
-by creating or deleting entries, while the search is in
-progress.
+by creating or deleting entries, while the search is in progress,
+with the exception of deleting the entry returned by
+\fBTcl_FirstHashEntry\fR or \fBTcl_NextHashEntry\fR.
.PP
\fBTcl_HashStats\fR returns a dynamically-allocated string with
overall information about a hash table, such as the number of