avoid extra sha1_hash memory copy, minor formatting (#1968)
This commit is contained in:
parent
11c75da314
commit
0b391d6351
|
@ -367,9 +367,8 @@ namespace libtorrent {
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace detail {
|
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``
|
// 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.
|
// refers to a directory, files will be added recursively from the directory.
|
||||||
|
|
|
@ -51,7 +51,7 @@ using namespace std::placeholders;
|
||||||
|
|
||||||
namespace libtorrent {
|
namespace libtorrent {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
inline bool default_pred(std::string const&) { return true; }
|
inline bool default_pred(std::string const&) { return true; }
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ namespace {
|
||||||
st->iothread.abort(true);
|
st->iothread.abort(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
st->ct.set_hash(piece, sha1_hash(piece_hash));
|
st->ct.set_hash(piece, piece_hash);
|
||||||
st->f(st->completed_piece);
|
st->f(st->completed_piece);
|
||||||
++st->completed_piece;
|
++st->completed_piece;
|
||||||
if (st->piece_counter < st->ct.files().end_piece())
|
if (st->piece_counter < st->ct.files().end_piece())
|
||||||
|
|
Loading…
Reference in New Issue