--- parser3/src/main/Attic/pa_hash.C 2001/04/12 14:50:29 1.33 +++ parser3/src/main/Attic/pa_hash.C 2001/06/28 07:41:59 1.36 @@ -5,8 +5,9 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_hash.C,v 1.33 2001/04/12 14:50:29 paf Exp $ + $Id: pa_hash.C,v 1.36 2001/06/28 07:41:59 parser Exp $ */ +static char *RCSId="$Id: pa_hash.C,v 1.36 2001/06/28 07:41:59 parser Exp $"; /* The prime numbers used from zend_hash.c, @@ -16,8 +17,6 @@ For more information about Zend please visit http://www.zend.com/ */ -#include "pa_config_includes.h" - #include "pa_hash.h" void *Hash::Pair::operator new(size_t size, Pool& apool) { @@ -160,6 +159,16 @@ void Hash::for_each(For_each_func func, (*func)(pair->key, pair->value, info); } +Hash::Val* Hash::first_that(First_that_func func, void *info) const { + Pair **ref=refs; + for(int index=0; indexlink) + if(pair->value) + if((*func)(pair->key, pair->value, info)) + return pair->value; + return 0; +} + void Hash::clear() { memset(refs, 0, sizeof(*refs)*allocated); used=0;