]> gcc.gnu.org Git - gcc.git/commitdiff
for_each_selectors.h: Minor uglification and stylistic fixes.
authorPaolo Carlini <paolo@gcc.gnu.org>
Tue, 13 Oct 2009 14:57:28 +0000 (14:57 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 13 Oct 2009 14:57:28 +0000 (14:57 +0000)
2009-10-13  Paolo Carlini  <paolo.carlini@oracle.com>

* include/parallel/for_each_selectors.h: Minor uglification and
stylistic fixes.

From-SVN: r152708

libstdc++-v3/ChangeLog
libstdc++-v3/include/parallel/for_each_selectors.h

index 9184ecd566c89d0732ebda3f1c6808294af6bfc7..424967d35605a199351276b668d7421d8aceba26 100644 (file)
@@ -1,6 +1,12 @@
+2009-10-13  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * include/parallel/for_each_selectors.h: Minor uglification and
+       stylistic fixes.
+
 2009-10-13  Edward Smith-Rowland  <3dw4rd@verizon.net>
 
-       * include/precompiled/stdc++.h: Include <initializer_list> for completeness.
+       * include/precompiled/stdc++.h: Include <initializer_list>
+       for completeness.
 
 2009-10-12  Paolo Carlini  <paolo.carlini@oracle.com>
 
index 9fd432df0219aff0235e7b80a5575faa1ba238de..3a37e5ca63749dcb65a1eea233eb4904301a59c2 100644 (file)
 
 namespace __gnu_parallel
 {
-
   /** @brief Generic __selector for embarrassingly parallel functions. */
   template<typename _It>
-  struct __generic_for_each_selector
-  {
-    /** @brief _Iterator on last element processed; needed for some
-     *  algorithms (e. g. std::transform()).
-     */
-    _It _M_finish_iterator;
-  };
-
+    struct __generic_for_each_selector
+    {
+      /** @brief _Iterator on last element processed; needed for some
+       *  algorithms (e. g. std::transform()).
+       */
+      _It _M_finish_iterator;
+    };
 
   /** @brief std::for_each() selector. */
   template<typename _It>
@@ -220,21 +218,21 @@ namespace __gnu_parallel
     };
 
   /** @brief std::inner_product() selector. */
-  template<typename _It, typename It2, typename _Tp>
+  template<typename _It, typename _It2, typename _Tp>
     struct __inner_product_selector : public __generic_for_each_selector<_It>
     {
       /** @brief Begin iterator of first sequence. */
-      _It __begin1_iterator;
+      _It  __begin1_iterator;
 
       /** @brief Begin iterator of second sequence. */
-      It2 begin2_iterator;
+      _It2 __begin2_iterator;
 
       /** @brief Constructor.
        *  @param b1 Begin iterator of first sequence.
        *  @param b2 Begin iterator of second sequence. */
       explicit
-      __inner_product_selector(_It b1, It2 b2)
-      : __begin1_iterator(b1), begin2_iterator(b2) { }
+      __inner_product_selector(_It __b1, _It2 __b2)
+      : __begin1_iterator(__b1), __begin2_iterator(__b2) { }
 
       /** @brief Functor execution.
        *  @param __mult Multiplication functor.
@@ -246,7 +244,7 @@ namespace __gnu_parallel
         {
           typename std::iterator_traits<_It>::difference_type __position
             = __current - __begin1_iterator;
-          return __mult(*__current, *(begin2_iterator + __position));
+          return __mult(*__current, *(__begin2_iterator + __position));
         }
     };
 
@@ -268,8 +266,8 @@ namespace __gnu_parallel
    *  __elements.
    */
   template<typename _It>
-    struct __adjacent_difference_selector :
-           public __generic_for_each_selector<_It>
+    struct __adjacent_difference_selector
+    : public __generic_for_each_selector<_It>
     {
       template<typename _Op>
         bool
@@ -293,14 +291,14 @@ namespace __gnu_parallel
      *  @param __i iterator referencing object. */
     template<typename _It>
       void
-      operator()(_It __i) { }
+      operator()(_It) { }
   };
 
   /** @brief Reduction function doing nothing. */
   struct _DummyReduct
   {
     bool
-    operator()(bool /*__x*/, bool /*__y*/) const
+    operator()(bool, bool) const
     { return true; }
   };
 
@@ -315,12 +313,7 @@ namespace __gnu_parallel
 
       _It
       operator()(_It __x, _It __y)
-      {
-        if (__comp(*__x, *__y))
-          return __x;
-        else
-          return __y;
-      }
+      { return (__comp(*__x, *__y)) ? __x : __y; }
     };
 
   /** @brief Reduction for finding the maximum element, using a comparator. */
@@ -334,12 +327,7 @@ namespace __gnu_parallel
 
       _It
       operator()(_It __x, _It __y)
-      {
-        if (__comp(*__x, *__y))
-          return __y;
-        else
-          return __x;
-      }
+      { return (__comp(*__x, *__y)) ? __y : __x; }
     };
 
   /** @brief General reduction, using a binary operator. */
This page took 0.082954 seconds and 5 git commands to generate.