--- parser3/src/include/pa_hash.h 2015/09/24 20:14:03 1.88 +++ parser3/src/include/pa_hash.h 2015/09/28 21:35:51 1.91 @@ -17,7 +17,7 @@ #ifndef PA_HASH_H #define PA_HASH_H -#define IDENT_PA_HASH_H "$Id: pa_hash.h,v 1.88 2015/09/24 20:14:03 moko Exp $" +#define IDENT_PA_HASH_H "$Id: pa_hash.h,v 1.91 2015/09/28 21:35:51 moko Exp $" #include "pa_memory.h" #include "pa_types.h" @@ -116,11 +116,11 @@ inline uint hash_code(int self) { #endif template class HASH: public PA_Object { +protected: + class Pair; public: - typedef K key_type; typedef V value_type; - class Pair; HASH() { allocated=Hash_allocates[allocates_index=0]; @@ -615,9 +615,19 @@ public: class Iterator { const HASH_STRING& fhash; Pair *fcurrent; +#ifndef HASH_ORDER + int i; +#endif public: Iterator(const HASH_STRING& ahash): fhash(ahash) { +#ifdef HASH_ORDER fcurrent=fhash.first; +#else + fcurrent=0; + for(i=0; inext; +#else + if(fcurrent=fcurrent->link) + return; + for(i++; i