mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-14 21:26:17 +00:00
* Removed duplicate portions of some rak/ headers.
* Properly set uninterested when the peer doesn't have any more pieces we're interested in. * #180, the ResourceManager didn't iterate over downloads with weight 0, causing those with priority off to not to perform choking nor get counted in the total. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@649 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+11
-4
@@ -67,13 +67,14 @@ public:
|
||||
// void erase(value_type r);
|
||||
|
||||
// Find the first ranges that has an end greater than index.
|
||||
inline iterator find(Type index);
|
||||
iterator find(Type index);
|
||||
const_iterator find(Type index) const;
|
||||
|
||||
// Use find with no closest match.
|
||||
inline bool has(Type index);
|
||||
bool has(Type index) const;
|
||||
|
||||
private:
|
||||
inline void unify(iterator itr);
|
||||
void unify(iterator itr);
|
||||
};
|
||||
|
||||
template <typename Type>
|
||||
@@ -109,10 +110,16 @@ ranges<Type>::find(Type index) {
|
||||
return std::find_if(begin(), end(), rak::less(index, rak::mem_ptr_ref(&value_type::second)));
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
inline typename ranges<Type>::const_iterator
|
||||
ranges<Type>::find(Type index) const {
|
||||
return std::find_if(begin(), end(), rak::less(index, rak::mem_ptr_ref(&value_type::second)));
|
||||
}
|
||||
|
||||
// Use find with no closest match.
|
||||
template <typename Type>
|
||||
inline bool
|
||||
ranges<Type>::has(Type index) {
|
||||
ranges<Type>::has(Type index) const {
|
||||
const_iterator itr = find(index);
|
||||
|
||||
return itr != end() && index >= itr->first;
|
||||
|
||||
Reference in New Issue
Block a user