removed duplicate function getDataFromSlot from HashTableX

This commit is contained in:
Brian Rasmusson
2016-10-18 20:22:12 +02:00
parent 95dea89039
commit cec1f4d930
4 changed files with 8 additions and 10 deletions

@ -267,8 +267,6 @@ class HashTableX {
void * getValueFromSlot ( int32_t n ) { return m_vals + n * m_ds; }
const void *getValueFromSlot ( int32_t n ) const { return m_vals + n * m_ds; }
void * getDataFromSlot ( int32_t n ) { return m_vals + n * m_ds; }
const void *getDataFromSlot ( int32_t n ) const { return m_vals + n * m_ds; }
// frees the used memory, etc.
void reset ( );

@ -302,7 +302,7 @@ bool Speller::loadUnifiedDict() {
// now add in from wiktionary
int32_t slot = wkfMap.getSlot ( &key );
for ( ; slot >= 0 ; slot = wkfMap.getNextSlot(slot,&key) ) {
uint8_t langId = *(char *)wkfMap.getDataFromSlot(slot);
uint8_t langId = *(char *)wkfMap.getValueFromSlot(slot);
if ( langId == langUnknown ) continue;
if ( langId == langTranslingual ) continue;
// if it marked as already in that dictionary, cont
@ -403,7 +403,7 @@ bool Speller::loadUnifiedDict() {
// now add in from wiktionary map
int32_t slot = wkfMap.getSlot ( &key );
for ( ; slot >= 0 ; slot = wkfMap.getNextSlot(slot,&key) ) {
uint8_t langId = *(char *)wkfMap.getDataFromSlot(slot);
uint8_t langId = *(char *)wkfMap.getValueFromSlot(slot);
if ( langId == langUnknown ) continue;
if ( langId == langTranslingual ) continue;
if ( pops[langId] ) continue;

@ -3065,7 +3065,7 @@ bool SpiderColl::scanListForWinners ( ) {
// so we can kick out a lower priority version of the same url.
int32_t winSlot = m_winnerTable.getSlot ( &uh48 );
if ( winSlot >= 0 ) {
key192_t *oldwk = (key192_t *)m_winnerTable.getDataFromSlot ( winSlot );
key192_t *oldwk = (key192_t *)m_winnerTable.getValueFromSlot ( winSlot );
// get the min hopcount
SpiderRequest *wsreq ;

@ -1837,7 +1837,7 @@ bool Wiktionary::compile ( ) {
// must match
if ( kk != fh64 ) continue;
// get a form of the base form, wid64
char *data = (char *)m_tmp.getDataFromSlot(j);
char *data = (char *)m_tmp.getValueFromSlot(j);
// must be there
int32_t *offPtr = (int32_t *)m_debugMap.getValue(data);
@ -1876,7 +1876,7 @@ bool Wiktionary::compile ( ) {
// need 2+ forms!
if ( formCount +stripCount <= 1 ) continue;
// base form
//int64_t wid = *(int64_t *)m_tmp.getDataFromSlot(i);
//int64_t wid = *(int64_t *)m_tmp.getValueFromSlot(i);
// remember buf start
int32_t bufLen = m_synBuf.length();
// remove dups
@ -1902,7 +1902,7 @@ bool Wiktionary::compile ( ) {
// must match
if ( kk != fh64 ) continue;
// get a form of the base form, wid64
char *data = (char *)m_tmp.getDataFromSlot(j);
char *data = (char *)m_tmp.getValueFromSlot(j);
// get the word id
//int64_t wid =*(int64_t *)data;
// CRAP! this is a case dependent hash! we need
@ -2020,7 +2020,7 @@ bool Wiktionary::integrateUnifiedDict ( ) {
// skip empty slots
if ( ! ud->m_flags[i] ) continue;
// get ptrs
int32_t off = *(int32_t *)ud->getDataFromSlot(i);
int32_t off = *(int32_t *)ud->getValueFromSlot(i);
// refernce
char *p = g_speller.m_unifiedBuf + off;
// just one lang?
@ -2038,7 +2038,7 @@ bool Wiktionary::integrateUnifiedDict ( ) {
// skip empty slots
if ( ! m_langTableTmp.m_flags[i] ) continue;
// check it
if ( *(uint8_t *)m_langTableTmp.getDataFromSlot(i) ==
if ( *(uint8_t *)m_langTableTmp.getValueFromSlot(i) ==
langTranslingual )
continue;
// add it