forked from premiere/premiere-libtorrent
Avoid performance penalty if disk write access log is not enable.
This commit is contained in:
parent
cd8a4d2511
commit
a1a8e1fc48
|
@ -62,6 +62,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#ifdef TORRENT_DISK_STATS
|
#ifdef TORRENT_DISK_STATS
|
||||||
#include "libtorrent/io.hpp"
|
#include "libtorrent/io.hpp"
|
||||||
|
#include "libtorrent/storage.hpp"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -1274,6 +1275,8 @@ namespace libtorrent
|
||||||
#ifdef TORRENT_DISK_STATS
|
#ifdef TORRENT_DISK_STATS
|
||||||
boost::uint32_t silly_hash(std::string const& str)
|
boost::uint32_t silly_hash(std::string const& str)
|
||||||
{
|
{
|
||||||
|
if (!default_storage::disk_write_access_log()) return 0;
|
||||||
|
|
||||||
boost::uint32_t ret = 1;
|
boost::uint32_t ret = 1;
|
||||||
for (int i = 0; i < str.size(); ++i)
|
for (int i = 0; i < str.size(); ++i)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue