summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2011-04-06 13:23:25 +0800
committerPeng Wu <alexepico@gmail.com>2011-04-06 13:23:25 +0800
commit0d68d1990958df65f8cde110756ee18c785d51cc (patch)
treeef1722b37585b9e5e85f800167851b8254564788 /src
parentb92726f8d77634f89b34d4f72efb75a5b3aad586 (diff)
downloadlibpinyin-0d68d1990958df65f8cde110756ee18c785d51cc.tar.gz
libpinyin-0d68d1990958df65f8cde110756ee18c785d51cc.tar.xz
libpinyin-0d68d1990958df65f8cde110756ee18c785d51cc.zip
refine code
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 c6b1736..5929ba9 100644
--- a/src/storage/ngram.cpp
+++ b/src/storage/ngram.cpp
@@ -38,15 +38,15 @@ SingleGram::SingleGram(void * buffer, size_t length){
m_chunk.set_chunk(buffer, length, NULL);
}
-bool SingleGram::set_total_freq(guint32 total){
+bool SingleGram::get_total_freq(guint32 & total){
char * buf_begin = (char *)m_chunk.begin();
- *((guint32 *)buf_begin) = total;
+ total = *((guint32 *)buf_begin);
return true;
}
-bool SingleGram::get_total_freq(guint32 & total){
+bool SingleGram::set_total_freq(guint32 total){
char * buf_begin = (char *)m_chunk.begin();
- total = *((guint32 *)buf_begin);
+ *((guint32 *)buf_begin) = total;
return true;
}