PackedList bugfix, HashTable tweak

- it was possible to create a PackedList::iterator from a
  PackedList::const_iterator and violate const-ness

- added HashTable::printInfo for emitting some information

- changed default table sizes from 100 -> 128 in preparation for future
  2^n table sizes
This commit is contained in:
Mark Olesen
2009-02-26 15:32:47 +01:00
parent e562aecb73
commit 2aeee852e8
17 changed files with 159 additions and 34 deletions

View File

@ -133,7 +133,7 @@ inline bool Foam::string::meta(const string& str, const char quote)
template<class String>
inline Foam::string
inline Foam::string
Foam::string::quotemeta(const string& str, const char quote)
{
if (!quote)
@ -205,14 +205,14 @@ inline Foam::string::size_type Foam::string::hash::operator()
const string& key
) const
{
register size_type hashVal = 0;
register size_type val = 0;
for (string::const_iterator iter=key.begin(); iter!=key.end(); ++iter)
{
hashVal = hashVal<<1 ^ *iter;
val = (val << 1) ^ *iter;
}
return hashVal;
return val;
}