aboutsummaryrefslogtreecommitdiffstats
path: root/Hilbert/BigBitVec.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-08-05 10:51:15 +0200
committerDavid Robillard <d@drobilla.net>2018-08-07 20:01:17 +0200
commit5472d2524a319602371d1918b5645efbfef474d3 (patch)
tree18059f5a249d8ba2904159bacb4c93f4753f6803 /Hilbert/BigBitVec.hpp
parent1b0f59972bbb0e3e424ad5ce7a2bd22a7e6f0a1a (diff)
downloadchilbert-5472d2524a319602371d1918b5645efbfef474d3.tar.gz
chilbert-5472d2524a319602371d1918b5645efbfef474d3.tar.bz2
chilbert-5472d2524a319602371d1918b5645efbfef474d3.zip
Fix BigBitVec::fsb()
Diffstat (limited to 'Hilbert/BigBitVec.hpp')
-rw-r--r--Hilbert/BigBitVec.hpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/Hilbert/BigBitVec.hpp b/Hilbert/BigBitVec.hpp
index dee7b77..bea0c41 100644
--- a/Hilbert/BigBitVec.hpp
+++ b/Hilbert/BigBitVec.hpp
@@ -661,15 +661,12 @@ public:
int
fsb() const
{
- int c, i, j;
- c = 0;
- for ( i = 0; i < m_iRacks; i++ )
+ for (int i = 0; i < m_iRacks; ++i )
{
- j = m_pcRacks[i].fsb();
- if ( j < FBV_BITS )
- return c + j;
- else
- c += FBV_BITS;
+ const int j = m_pcRacks[i].fsb();
+ if ( j ) {
+ return (i * FBV_BITS) + j;
+ }
}
return 0;
}