From a1a8e1fc48dcc5724bb3ea16cf06d707c48f1c21 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Mon, 3 Aug 2015 00:34:11 -0400 Subject: [PATCH] Avoid performance penalty if disk write access log is not enable. --- src/file.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/file.cpp b/src/file.cpp index 513f86569..20d49d164 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -62,6 +62,7 @@ POSSIBILITY OF SUCH DAMAGE. #ifdef TORRENT_DISK_STATS #include "libtorrent/io.hpp" +#include "libtorrent/storage.hpp" #endif #include @@ -1274,6 +1275,8 @@ namespace libtorrent #ifdef TORRENT_DISK_STATS boost::uint32_t silly_hash(std::string const& str) { + if (!default_storage::disk_write_access_log()) return 0; + boost::uint32_t ret = 1; for (int i = 0; i < str.size(); ++i) {