[PPL-devel] [GIT] ppl/ppl(master): Simplified implementation.

Abramo Bagnara abramo.bagnara at gmail.com
Thu Nov 3 19:57:41 CET 2011


Module: ppl/ppl
Branch: master
Commit: efed831cda3f447da48885d3a3f52282d5abc4a4
URL:    http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=efed831cda3f447da48885d3a3f52282d5abc4a4

Author: Abramo Bagnara <abramo.bagnara at gmail.com>
Date:   Thu Nov  3 19:57:23 2011 +0100

Simplified implementation.

---

 src/math_utilities.inlines.hh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/math_utilities.inlines.hh b/src/math_utilities.inlines.hh
index 550156c..db38860 100644
--- a/src/math_utilities.inlines.hh
+++ b/src/math_utilities.inlines.hh
@@ -44,7 +44,7 @@ template <typename T>
 inline T
 low_bits_mask(const unsigned n) {
   PPL_ASSERT(n < unsigned(std::numeric_limits<T>::digits));
-  return (n == 0) ? 0 : ~(~(T(0u)) << n);
+  return ~((~static_cast<T>(0)) << n);
 }
 
 template <typename T>




More information about the PPL-devel mailing list