diff options
author | David Robillard <d@drobilla.net> | 2018-08-07 19:32:52 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-29 14:46:17 +0200 |
commit | 12a5b1aa57976b6a2be04efd224b7109df702f52 (patch) | |
tree | a24ff19926c7d693ad9285a50c9f4263e0460e65 | |
parent | a9116ca7e7913dd6cfb415df65e0e7cbc93b1f82 (diff) | |
download | chilbert-12a5b1aa57976b6a2be04efd224b7109df702f52.tar.gz chilbert-12a5b1aa57976b6a2be04efd224b7109df702f52.tar.bz2 chilbert-12a5b1aa57976b6a2be04efd224b7109df702f52.zip |
Move conditional comments inside branches
-rw-r--r-- | chilbert/Algorithm.hpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/chilbert/Algorithm.hpp b/chilbert/Algorithm.hpp index 9f44e3a..cdf76a8 100644 --- a/chilbert/Algorithm.hpp +++ b/chilbert/Algorithm.hpp @@ -205,12 +205,13 @@ coordsToIndex( H &h // [out] Hilbert index ) { - // Intermediate variables will fit in fixed width? - if ( n <= FBV_BITS ) + if ( n <= FBV_BITS ) { + // Intermediate variables will fit in fixed width _coordsToIndex<P,H,CFixBitVec>(p,m,n,h, CFixBitVec{}); - // Otherwise, they must be BigBitVecs. - else + } else { + // Otherwise, they must be BigBitVecs _coordsToIndex<P,H,CBigBitVec>(p,m,n,h, CBigBitVec(n)); + } } @@ -282,12 +283,13 @@ indexToCoords( const H &h // [out] Hilbert index ) { - // Intermediate variables will fit in fixed width? - if ( n <= FBV_BITS ) + if ( n <= FBV_BITS ) { + // Intermediate variables will fit in fixed width _indexToCoords<P,H,CFixBitVec>(p,m,n,h,CFixBitVec{}); - // Otherwise, they must be BigBitVecs. - else + } else { + // Otherwise, they must be BigBitVecs _indexToCoords<P,H,CBigBitVec>(p,m,n,h,CBigBitVec(n)); + } } template <class P,class HC,class I> @@ -359,12 +361,13 @@ coordsToCompactIndex( int m = 0 ) { - // Intermediate variables will fit in fixed width? - if ( n <= FBV_BITS ) + if ( n <= FBV_BITS ) { + // Intermediate variables will fit in fixed width? _coordsToCompactIndex<P,HC,CFixBitVec>(p,ms,n,hc,CFixBitVec{},M,m); - // Otherwise, they must be BigBitVecs. - else + } else { + // Otherwise, they must be BigBitVecs. _coordsToCompactIndex<P,HC,CBigBitVec>(p,ms,n,hc,CBigBitVec(n),M,m); + } } template <class P,class HC,class I> @@ -459,12 +462,12 @@ compactIndexToCoords( int m = 0 ) { - // Intermediate variables will fit in fixed width? if ( n <= FBV_BITS ) { + // Intermediate variables will fit in fixed width CFixBitVec scratch; _compactIndexToCoords<P,HC,CFixBitVec>(p,ms,n,hc,CFixBitVec{},M,m); - // Otherwise, they must be BigBitVecs. } else { + // Otherwise, they must be BigBitVecs CBigBitVec scratch(n); _compactIndexToCoords<P,HC,CBigBitVec>(p,ms,n,hc,std::move(scratch),M,m); } |