Kouhei Sutou
null+****@clear*****
Tue Nov 10 11:21:17 JST 2015
Kouhei Sutou 2015-11-10 11:21:17 +0900 (Tue, 10 Nov 2015) New Revision: 48c0ae883c5dd18033395d8a42fa72f9bf944504 https://github.com/mroonga/mroonga/commit/48c0ae883c5dd18033395d8a42fa72f9bf944504 Message: Simplify for readability Modified files: lib/mrn_context_pool.cpp Modified: lib/mrn_context_pool.cpp (+6 -6) =================================================================== --- lib/mrn_context_pool.cpp 2015-11-10 11:19:55 +0900 (1b3060a) +++ lib/mrn_context_pool.cpp 2015-11-10 11:21:17 +0900 (96fa9b5) @@ -41,7 +41,7 @@ namespace mrn { grn_ctx *pull(void) { MRN_DBUG_ENTER_METHOD(); - grn_ctx *ctx; + grn_ctx *ctx = NULL; { time_t now; @@ -54,14 +54,14 @@ namespace mrn { if ((now - last_pull_time_) >= CLEAR_THREATHOLD_IN_SECONDS) { clear(); } - last_pull_time_ = now; - DBUG_RETURN(ctx); - } else { - last_pull_time_ = now; } + last_pull_time_ = now; + } + + if (!ctx) { + ctx = grn_ctx_open(0); } - ctx = grn_ctx_open(0); DBUG_RETURN(ctx); } -------------- next part -------------- HTML����������������������������... ダウンロード