From 0d68d1990958df65f8cde110756ee18c785d51cc Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 6 Apr 2011 13:23:25 +0800 Subject: refine code --- src/storage/ngram.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/storage/ngram.cpp') 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; } -- cgit