From c7c8dda99cdf334803b72da07d8389e19cf365d8 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 10 May 2011 13:12:36 +0800 Subject: fixes a typo in the load method of flexible ngram --- src/storage/flexible_ngram.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/storage') diff --git a/src/storage/flexible_ngram.h b/src/storage/flexible_ngram.h index e5a086b..83cf439 100644 --- a/src/storage/flexible_ngram.h +++ b/src/storage/flexible_ngram.h @@ -351,9 +351,11 @@ public: DBT db_data; memset(&db_data, 0, sizeof(DBT)); int ret = m_db->get(m_db, NULL, &db_key, &db_data, 0); - if ( ret == 0) - single_gram = new FlexibleSingleGram - (db_data.data, db_data.size); + if ( ret != 0) + return false; + + single_gram = new FlexibleSingleGram + (db_data.data, db_data.size); return true; } -- cgit