summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/storage/ngram.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/storage/ngram.cpp b/src/storage/ngram.cpp
index 49e7c6f..f0319f4 100644
--- a/src/storage/ngram.cpp
+++ b/src/storage/ngram.cpp
@@ -243,14 +243,14 @@ bool Bigram::attach(const char * dbfile, guint32 flags){
}
bool Bigram::load(phrase_token_t index, SingleGram * & single_gram){
+ single_gram = NULL;
+ if ( !m_db )
+ return false;
+
DBT db_key;
memset(&db_key, 0, sizeof(DBT));
db_key.data = &index;
db_key.size = sizeof(phrase_token_t);
-
- single_gram = NULL;
- if ( !m_db )
- return false;
DBT db_data;
memset(&db_data, 0, sizeof(DBT));