Commit 33e19d67 authored by Scott Wheeler's avatar Scott Wheeler

CVS_SILENT more cleanups from my silly variable renamer script

svn path=/trunk/kdemultimedia/juk/; revision=212469
parent f6da7f7a
...@@ -19,14 +19,14 @@ ...@@ -19,14 +19,14 @@
static const int tableSize = 5003; static const int tableSize = 5003;
class StringHash::m_Node class StringHash::Node
{ {
public: public:
m_Node(const QString &value) : key(value), next(0) {} Node(const QString &value) : key(value), next(0) {}
~m_Node() {} ~Node() {}
QString key; QString key;
m_Node *next; Node *next;
}; };
StringHash::StringHash() : m_table(tableSize) StringHash::StringHash() : m_table(tableSize)
...@@ -43,8 +43,8 @@ StringHash::~StringHash() ...@@ -43,8 +43,8 @@ StringHash::~StringHash()
bool StringHash::insert(const QString &value) bool StringHash::insert(const QString &value)
{ {
int h = hash(value); int h = hash(value);
m_Node *i = m_table[h]; Node *i = m_table[h];
m_Node *j = 0; Node *j = 0;
while(i) { while(i) {
if(i->key == value) if(i->key == value)
...@@ -56,9 +56,9 @@ bool StringHash::insert(const QString &value) ...@@ -56,9 +56,9 @@ bool StringHash::insert(const QString &value)
} }
if(j) if(j)
j->next = new m_Node(value); j->next = new Node(value);
else else
m_table.insert(h, new m_Node(value)); m_table.insert(h, new Node(value));
return false; return false;
} }
...@@ -66,7 +66,7 @@ bool StringHash::insert(const QString &value) ...@@ -66,7 +66,7 @@ bool StringHash::insert(const QString &value)
bool StringHash::contains(const QString &value) const bool StringHash::contains(const QString &value) const
{ {
int h = hash(value); int h = hash(value);
m_Node *i = m_table[h]; Node *i = m_table[h];
while(i && i->key != value) while(i && i->key != value)
i = i->next; i = i->next;
...@@ -79,7 +79,7 @@ QStringList StringHash::values() const ...@@ -79,7 +79,7 @@ QStringList StringHash::values() const
{ {
QStringList l; QStringList l;
m_Node *n; Node *n;
for(int i = 0; i < tableSize; i++) { for(int i = 0; i < tableSize; i++) {
n = m_table[i]; n = m_table[i];
...@@ -119,7 +119,7 @@ int StringHash::hash(const QString &key) const ...@@ -119,7 +119,7 @@ int StringHash::hash(const QString &key) const
return index % tableSize; return index % tableSize;
} }
void StringHash::deleteNode(m_Node *n) void StringHash::deleteNode(Node *n)
{ {
if(n) { if(n) {
deleteNode(n->next); deleteNode(n->next);
......
...@@ -39,11 +39,11 @@ public: ...@@ -39,11 +39,11 @@ public:
// QStringList values() const; // QStringList values() const;
private: private:
class m_Node; class Node;
int hash(const QString &key) const; int hash(const QString &key) const;
void deleteNode(m_Node *n); void deleteNode(Node *n);
QPtrVector<m_Node> m_table; QPtrVector<Node> m_table;
}; };
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment