mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-13 04:36:16 +00:00
* More clang warnings fixed.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1273 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -107,16 +107,16 @@ private:
|
|||||||
template<typename Key, typename T, typename C, typename A>
|
template<typename Key, typename T, typename C, typename A>
|
||||||
inline typename RangeMap<Key,T,C,A>::iterator
|
inline typename RangeMap<Key,T,C,A>::iterator
|
||||||
RangeMap<Key,T,C,A>::crop_overlap(const Key& _begin, const Key& _end) {
|
RangeMap<Key,T,C,A>::crop_overlap(const Key& _begin, const Key& _end) {
|
||||||
typename RangeMap::iterator itr = upper_bound(_begin);
|
typename RangeMap::iterator itr = base_type::upper_bound(_begin);
|
||||||
|
|
||||||
while (itr != end() && key_comp()(itr->second.first, _end)) {
|
while (itr != end() && key_comp()(itr->second.first, _end)) {
|
||||||
// There's a subrange before the new begin: need new entry (new range end means new key).
|
// There's a subrange before the new begin: need new entry (new range end means new key).
|
||||||
if (key_comp()(itr->second.first, _begin))
|
if (key_comp()(itr->second.first, _begin))
|
||||||
insert(itr, typename RangeMap::value_type(_begin, itr->second));
|
base_type::insert(itr, typename RangeMap::value_type(_begin, itr->second));
|
||||||
|
|
||||||
// Old end is within our range: erase entry.
|
// Old end is within our range: erase entry.
|
||||||
if (!key_comp()(_end, itr->first)) {
|
if (!key_comp()(_end, itr->first)) {
|
||||||
erase(itr++);
|
base_type::erase(itr++);
|
||||||
|
|
||||||
// Otherwise simply set the new begin of the old range.
|
// Otherwise simply set the new begin of the old range.
|
||||||
} else {
|
} else {
|
||||||
@@ -142,7 +142,7 @@ RangeMap<Key,T,C,A>::set_merge(Key _begin, const Key& _end, const T& value) {
|
|||||||
typename RangeMap::iterator prev = itr;
|
typename RangeMap::iterator prev = itr;
|
||||||
if (!key_comp()((--prev)->first, _begin) && prev->second.second == value) {
|
if (!key_comp()((--prev)->first, _begin) && prev->second.second == value) {
|
||||||
_begin = prev->second.first;
|
_begin = prev->second.first;
|
||||||
erase(prev);
|
base_type::erase(prev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ RangeMap<Key,T,C,A>::set_merge(Key _begin, const Key& _end, const T& value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise, this range isn't mergeable, make new entry.
|
// Otherwise, this range isn't mergeable, make new entry.
|
||||||
return insert(itr, typename RangeMap::value_type(_end, typename RangeMap::mapped_type(_begin, value)));
|
return base_type::insert(itr, typename RangeMap::value_type(_end, typename RangeMap::mapped_type(_begin, value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Key, typename T, typename C, typename A>
|
template<typename Key, typename T, typename C, typename A>
|
||||||
@@ -162,13 +162,13 @@ RangeMap<Key,T,C,A>::set_range(const Key& _begin, const Key& _end, const T& valu
|
|||||||
if (!key_comp()(_begin, _end))
|
if (!key_comp()(_begin, _end))
|
||||||
return end();
|
return end();
|
||||||
|
|
||||||
return insert(crop_overlap(_begin, _end), typename RangeMap::value_type(_end, typename RangeMap::mapped_type(_begin, value)));
|
return base_type::insert(crop_overlap(_begin, _end), typename RangeMap::value_type(_end, typename RangeMap::mapped_type(_begin, value)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Key, typename T, typename C, typename A>
|
template<typename Key, typename T, typename C, typename A>
|
||||||
inline typename RangeMap<Key,T,C,A>::const_iterator
|
inline typename RangeMap<Key,T,C,A>::const_iterator
|
||||||
RangeMap<Key,T,C,A>::find(const Key& key) const {
|
RangeMap<Key,T,C,A>::find(const Key& key) const {
|
||||||
typename RangeMap::const_iterator itr = upper_bound(key);
|
typename RangeMap::const_iterator itr = base_type::upper_bound(key);
|
||||||
|
|
||||||
if (itr != end() && key_comp()(key, itr->second.first))
|
if (itr != end() && key_comp()(key, itr->second.first))
|
||||||
itr = end();
|
itr = end();
|
||||||
|
|||||||
Reference in New Issue
Block a user