summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/bits/stl_algobase.h
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-21 10:48:30 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2012-09-21 10:48:30 +0000
commit3e689832fc11ba21593f21bd05ea667618b1b192 (patch)
tree4921a33b3ba95e8540d34823350cba724599f814 /libstdc++-v3/include/bits/stl_algobase.h
parenta67545fe511f9a3dc48f8d0ec6cf0117b2058d8c (diff)
downloadppe42-gcc-3e689832fc11ba21593f21bd05ea667618b1b192.tar.gz
ppe42-gcc-3e689832fc11ba21593f21bd05ea667618b1b192.zip
2012-09-21 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_algobase.h (max, min): Use conditional operator. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191608 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/stl_algobase.h')
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h26
1 files changed, 6 insertions, 20 deletions
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index fe30f6ce9f5..3099d0d10f6 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -195,10 +195,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
// concept requirements
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
- //return __b < __a ? __b : __a;
- if (__b < __a)
- return __b;
- return __a;
+
+ return __b < __a ? __b : __a;
}
/**
@@ -218,10 +216,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
// concept requirements
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
- //return __a < __b ? __b : __a;
- if (__a < __b)
- return __b;
- return __a;
+
+ return __a < __b ? __b : __a;
}
/**
@@ -238,12 +234,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Compare>
inline const _Tp&
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
- {
- //return __comp(__b, __a) ? __b : __a;
- if (__comp(__b, __a))
- return __b;
- return __a;
- }
+ { return __comp(__b, __a) ? __b : __a; }
/**
* @brief This does what you think it does.
@@ -259,12 +250,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp, typename _Compare>
inline const _Tp&
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
- {
- //return __comp(__a, __b) ? __b : __a;
- if (__comp(__a, __b))
- return __b;
- return __a;
- }
+ { return __comp(__a, __b) ? __b : __a; }
// If _Iterator is a __normal_iterator return its base (a plain pointer,
// normally) otherwise return it untouched. See copy, fill, ...
OpenPOWER on IntegriCloud