made examples use the new more efficient torrent_info constructor

This commit is contained in:
Arvid Norberg
2008-06-24 11:54:13 +00:00
parent c50a538d99
commit 9780d378ed
2 changed files with 2 additions and 9 deletions

View File

@@ -479,10 +479,7 @@ void add_torrent(libtorrent::session& ses
{
using namespace libtorrent;
std::ifstream in(torrent.c_str(), std::ios_base::binary);
in.unsetf(std::ios_base::skipws);
entry e = bdecode(std::istream_iterator<char>(in), std::istream_iterator<char>());
boost::intrusive_ptr<torrent_info> t(new torrent_info(e));
boost::intrusive_ptr<torrent_info> t(new torrent_info(torrent.c_str()));
std::cout << t->name() << "\n";