Commit e5e94145 by Jim Xochellis Committed by Paolo Carlini

stl_algo.h (search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2,…

stl_algo.h (search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2)): Simplify general case loop to a for(;;).

2007-07-04  Jim Xochellis  <jimxoch@yahoo.gr>

	* include/bits/stl_algo.h (search(_ForwardIterator1,
	_ForwardIterator1, _ForwardIterator2, _ForwardIterator2)): Simplify
	general case loop to a for(;;).
	(search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
	_ForwardIterator2, _BinaryPredicate)): Likewise; remove redundant
	inner loop.

From-SVN: r126347
parent e9a57dc1
2007-07-04 Jim Xochellis <jimxoch@yahoo.gr>
* include/bits/stl_algo.h (search(_ForwardIterator1,
_ForwardIterator1, _ForwardIterator2, _ForwardIterator2)): Simplify
general case loop to a for(;;).
(search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2,
_ForwardIterator2, _BinaryPredicate)): Likewise; remove redundant
inner loop.
2007-07-03 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/31518
......
......@@ -639,7 +639,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__p1 = __first2; ++__p1;
_ForwardIterator1 __current = __first1;
while (__first1 != __last1)
for (;;)
{
__first1 = std::find(__first1, __last1, *__first2);
if (__first1 == __last1)
......@@ -718,16 +718,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
__p1 = __first2; ++__p1;
_ForwardIterator1 __current = __first1;
while (__first1 != __last1)
for (;;)
{
while (__first1 != __last1)
{
if (__predicate(*__first1, *__first2))
break;
++__first1;
}
while (__first1 != __last1 &&
!bool(__predicate(*__first1, *__first2)))
while (__first1 != __last1
&& !bool(__predicate(*__first1, *__first2)))
++__first1;
if (__first1 == __last1)
return __last1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment