summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-03 22:22:34 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-03 22:22:34 +0000
commit9c5ccb1d23b126ffa063f9d7c190b9c1912638a5 (patch)
tree6ff04d12ce87cd54bc813d10f1baaa6a9c502341
parentc454741c6ec0c91649dc163a84da77d631003a51 (diff)
downloadppe42-gcc-9c5ccb1d23b126ffa063f9d7c190b9c1912638a5.tar.gz
ppe42-gcc-9c5ccb1d23b126ffa063f9d7c190b9c1912638a5.zip
2004-11-03 Jonathan Wakely <redi@gcc.gnu.org>
* include/bits/stl_numeric.h (partial_sum, adjacent_difference): Avoid dereferencing two times __first in the prologue. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90038 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/stl_numeric.h8
2 files changed, 9 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 61246af8be8..6848060c05a 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-03 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * include/bits/stl_numeric.h (partial_sum, adjacent_difference):
+ Avoid dereferencing two times __first in the prologue.
+
2004-11-03 Paolo Carlini <pcarlini@suse.de>
* include/bits/stl_numeric.h: Trivial formatting fixes.
diff --git a/libstdc++-v3/include/bits/stl_numeric.h b/libstdc++-v3/include/bits/stl_numeric.h
index fc15fe3fc52..a11a0404e9a 100644
--- a/libstdc++-v3/include/bits/stl_numeric.h
+++ b/libstdc++-v3/include/bits/stl_numeric.h
@@ -209,8 +209,8 @@ namespace std
if (__first == __last)
return __result;
- *__result = *__first;
_ValueType __value = *__first;
+ *__result = __value;
while (++__first != __last)
{
__value = __value + *__first;
@@ -249,8 +249,8 @@ namespace std
if (__first == __last)
return __result;
- *__result = *__first;
_ValueType __value = *__first;
+ *__result = __value;
while (++__first != __last)
{
__value = __binary_op(__value, *__first);
@@ -285,8 +285,8 @@ namespace std
if (__first == __last)
return __result;
- *__result = *__first;
_ValueType __value = *__first;
+ *__result = __value;
while (++__first != __last)
{
_ValueType __tmp = *__first;
@@ -324,8 +324,8 @@ namespace std
if (__first == __last)
return __result;
- *__result = *__first;
_ValueType __value = *__first;
+ *__result = __value;
while (++__first != __last)
{
_ValueType __tmp = *__first;
OpenPOWER on IntegriCloud