summaryrefslogtreecommitdiff
path: root/inputmethods/dasher/AlphabetMap.cpp
Side-by-side diff
Diffstat (limited to 'inputmethods/dasher/AlphabetMap.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/dasher/AlphabetMap.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/inputmethods/dasher/AlphabetMap.cpp b/inputmethods/dasher/AlphabetMap.cpp
index 09e2c72..c687e45 100644
--- a/inputmethods/dasher/AlphabetMap.cpp
+++ b/inputmethods/dasher/AlphabetMap.cpp
@@ -1,39 +1,39 @@
// AlphabetMap.cpp
//
/////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2002 Iain Murray
//
/////////////////////////////////////////////////////////////////////////////
#include "AlphabetMap.h"
using namespace Dasher;
using namespace std;
alphabet_map::alphabet_map(unsigned int InitialTableSize)
- : Undefined(0), HashTable(InitialTableSize<<1)
+ : HashTable(InitialTableSize<<1), Undefined(0)
{
Entries.reserve(InitialTableSize);
}
void alphabet_map::Add(const string& Key, symbol Value)
{
RecursiveAdd(Key, Value, false);
}
void alphabet_map::RecursiveAdd(const string& Key, symbol Value, bool PrefixFlag)
{
Entry*& HashEntry = HashTable[Hash(Key)];
// Loop through Entries with the correct Hash value.
for (Entry* i = HashEntry; i; i=i->Next) {
if (i->Key==Key) {
if (PrefixFlag) {
// Just tagging - don't change symbol. Recurse if necessary
i->KeyIsPrefix = true;
if (Key.size()>1)
RecursiveAdd(Key.substr(Key.size()-1), Undefined, true);
} else {