avoid extra sha1_hash memory copy, minor formatting (#1968)

This commit is contained in:
Alden Torres 2017-05-04 17:35:40 -04:00 committed by Arvid Norberg
parent 11c75da314
commit 0b391d6351
2 changed files with 4 additions and 5 deletions

View File

@ -367,9 +367,8 @@ namespace libtorrent {
};
namespace detail {
inline void nop(piece_index_t) {}
}
inline void nop(piece_index_t) {}
}
// Adds the file specified by ``path`` to the file_storage object. In case ``path``
// refers to a directory, files will be added recursively from the directory.

View File

@ -51,7 +51,7 @@ using namespace std::placeholders;
namespace libtorrent {
namespace {
namespace {
inline bool default_pred(std::string const&) { return true; }
@ -179,7 +179,7 @@ namespace {
st->iothread.abort(true);
return;
}
st->ct.set_hash(piece, sha1_hash(piece_hash));
st->ct.set_hash(piece, piece_hash);
st->f(st->completed_piece);
++st->completed_piece;
if (st->piece_counter < st->ct.files().end_piece())