diff options
author | Peng Wu <alexepico@gmail.com> | 2015-04-21 11:19:00 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2015-04-21 11:19:00 +0800 |
commit | 107f642630eed151e859583d493ee677b5b063b9 (patch) | |
tree | 872ace6691a67facb5e326eeb118878b5f4d7dac /src/storage/ngram_bdb.cpp | |
parent | fb3a0fa827098b9c2f8885e1e55e761deccdac1d (diff) | |
download | libpinyin-107f642630eed151e859583d493ee677b5b063b9.tar.gz libpinyin-107f642630eed151e859583d493ee677b5b063b9.tar.xz libpinyin-107f642630eed151e859583d493ee677b5b063b9.zip |
add copy parameter to Bigram::load
Diffstat (limited to 'src/storage/ngram_bdb.cpp')
-rw-r--r-- | src/storage/ngram_bdb.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/storage/ngram_bdb.cpp b/src/storage/ngram_bdb.cpp index 9d696ff..bba7c1d 100644 --- a/src/storage/ngram_bdb.cpp +++ b/src/storage/ngram_bdb.cpp @@ -173,7 +173,8 @@ bool Bigram::attach(const char * dbfile, guint32 flags){ return true; } -bool Bigram::load(phrase_token_t index, SingleGram * & single_gram){ +bool Bigram::load(phrase_token_t index, SingleGram * & single_gram, + bool copy){ single_gram = NULL; if ( !m_db ) return false; @@ -189,7 +190,7 @@ bool Bigram::load(phrase_token_t index, SingleGram * & single_gram){ if ( ret != 0 ) return false; - single_gram = new SingleGram(db_data.data, db_data.size); + single_gram = new SingleGram(db_data.data, db_data.size, copy); return true; } |