From 9198a2a40a36d6c46b5d4d1e6371c8139f5002e9 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 21 Apr 2004 21:31:36 +0000 Subject: Added note about a safe and useful mode of update to a hash being iterated over. --- ChangeLog | 5 +++++ doc/Hash.3 | 7 ++++--- 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 + * 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 -- cgit v0.12