From 7af9b638774cba2bf0cfbdcc8f1a8e5a72453fa1 Mon Sep 17 00:00:00 2001 From: Connor1996 Date: Tue, 26 Jan 2021 17:40:12 +0800 Subject: [PATCH] not set blob cache when size is 0 Signed-off-by: Connor1996 --- src/titan.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/titan.rs b/src/titan.rs index da0b54561..ab51ea3b7 100644 --- a/src/titan.rs +++ b/src/titan.rs @@ -115,6 +115,9 @@ impl TitanDBOptions { capacity_limit: bool, pri_ratio: c_double, ) { + if size == 0 { + return; + } let mut cache_opt = LRUCacheOptions::new(); cache_opt.set_capacity(size); cache_opt.set_num_shard_bits(shard_bits);