minor refactor in file_storeage and typos

This commit is contained in:
Alden Torres 2017-05-02 19:44:07 -04:00 committed by Arvid Norberg
parent af495da56b
commit fd51c0b8bf
5 changed files with 6 additions and 7 deletions

View File

@ -65,4 +65,3 @@ POSSIBILITY OF SUCH DAMAGE.
#endif // FILENAME_MAX
#endif // TORRENT_MAX_PATH_HPP_INCLUDED

View File

@ -379,10 +379,10 @@ namespace libtorrent {
// returns the index of the one-past-end file in the file storage
file_index_t end_file() const
{ return file_index_t(int(m_files.size())); }
{ return m_files.end_index(); }
file_index_t last_file() const
{ return file_index_t(int(m_files.size()) - 1); }
{ return --m_files.end_index(); }
// returns the total number of bytes all the files in this torrent spans
std::int64_t total_size() const { return m_total_size; }

View File

@ -1430,7 +1430,7 @@ namespace libtorrent {
max_metadata_size,
#ifndef TORRENT_NO_DEPRECATE
// DEPRECTED: use aio_threads instead
// DEPRECATED: use aio_threads instead
// ``hashing_threads`` is the number of threads to use for piece hash
// verification. It defaults to 1. For very high download rates, on

View File

@ -521,7 +521,7 @@ namespace libtorrent {
// short reads as errors
ec.operation = storage_error::read;
// we either get an error or 0 or more bytes read
// we either get an error or 0 or more bytes read
TORRENT_ASSERT(e || ret >= 0);
TORRENT_ASSERT(ret <= bufs_size(vec));
@ -595,7 +595,7 @@ namespace libtorrent {
// short reads as errors
ec.operation = storage_error::write;
// we either get an error or 0 or more bytes read
// we either get an error or 0 or more bytes read
TORRENT_ASSERT(e || ret >= 0);
TORRENT_ASSERT(ret <= bufs_size(vec));

View File

@ -4049,7 +4049,7 @@ namespace libtorrent {
// the peer implementation can ask not to be disconnected.
// this is used for web seeds for instance, to instead of
// disconnecting, mark the file as not being haved.
// disconnecting, mark the file as not being had.
allow_disconnect = peer->received_invalid_data(index, single_peer);
}