From 12a5b1aa57976b6a2be04efd224b7109df702f52 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 7 Aug 2018 19:32:52 +0200 Subject: Move conditional comments inside branches --- chilbert/Algorithm.hpp | 31 +++++++++++++++++-------------- 1 file 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,m,n,h, CFixBitVec{}); - // Otherwise, they must be BigBitVecs. - else + } else { + // Otherwise, they must be BigBitVecs _coordsToIndex(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,m,n,h,CFixBitVec{}); - // Otherwise, they must be BigBitVecs. - else + } else { + // Otherwise, they must be BigBitVecs _indexToCoords(p,m,n,h,CBigBitVec(n)); + } } template @@ -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,ms,n,hc,CFixBitVec{},M,m); - // Otherwise, they must be BigBitVecs. - else + } else { + // Otherwise, they must be BigBitVecs. _coordsToCompactIndex(p,ms,n,hc,CBigBitVec(n),M,m); + } } template @@ -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,ms,n,hc,CFixBitVec{},M,m); - // Otherwise, they must be BigBitVecs. } else { + // Otherwise, they must be BigBitVecs CBigBitVec scratch(n); _compactIndexToCoords(p,ms,n,hc,std::move(scratch),M,m); } -- cgit v1.2.1