mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-30 07:14:09 +08:00
stl_algo.h (search_n): Improve the previous fix as suggested by Martin.
2003-09-29 Paolo Carlini <pcarlini@unitus.it> * include/bits/stl_algo.h (search_n): Improve the previous fix as suggested by Martin. From-SVN: r71913
This commit is contained in:
parent
3ec278de0b
commit
6821a40b74
@ -1,3 +1,8 @@
|
||||
2003-09-29 Paolo Carlini <pcarlini@unitus.it>
|
||||
|
||||
* include/bits/stl_algo.h (search_n): Improve the previous
|
||||
fix as suggested by Martin.
|
||||
|
||||
2003-09-29 Paolo Carlini <pcarlini@unitus.it>
|
||||
|
||||
PR libstdc++/12296
|
||||
|
@ -609,7 +609,8 @@ namespace std
|
||||
else {
|
||||
__first = std::find(__first, __last, __val);
|
||||
while (__first != __last) {
|
||||
typename iterator_traits<_ForwardIterator>::difference_type __n = __count - 1;
|
||||
typename iterator_traits<_ForwardIterator>::difference_type __n = __count;
|
||||
--__n;
|
||||
_ForwardIterator __i = __first;
|
||||
++__i;
|
||||
while (__i != __last && __n != 0 && *__i == __val) {
|
||||
@ -661,7 +662,8 @@ namespace std
|
||||
++__first;
|
||||
}
|
||||
while (__first != __last) {
|
||||
typename iterator_traits<_ForwardIterator>::difference_type __n = __count - 1;
|
||||
typename iterator_traits<_ForwardIterator>::difference_type __n = __count;
|
||||
--__n;
|
||||
_ForwardIterator __i = __first;
|
||||
++__i;
|
||||
while (__i != __last && __n != 0 && __binary_pred(*__i, __val)) {
|
||||
|
Loading…
Reference in New Issue
Block a user