From cc1a61db752ddc1d5033e9986a7d31971347e87a Mon Sep 17 00:00:00 2001 From: Roland Denis Date: Tue, 10 Mar 2015 10:30:12 +0100 Subject: [PATCH] Fixing a bug on iterators over labels. begin() iterator was equal to end() when the first bit was set. --- src/DGtal/base/Labels.ih | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DGtal/base/Labels.ih b/src/DGtal/base/Labels.ih index 8f756b2810..5825b33565 100644 --- a/src/DGtal/base/Labels.ih +++ b/src/DGtal/base/Labels.ih @@ -72,7 +72,7 @@ ConstEnumerator( const Word* address, SizeType firstWord ) else { myWord = 0; - myLabel = 0; + myLabel = -1; } } //----------------------------------------------------------------------------- @@ -132,7 +132,7 @@ operator++() if ( myWordLabel == ( __DGTAL_LABELS_NBWORDS * __DGTAL_WORD_NBDIGITS ) ) { - myLabel = 0; + myLabel = -1; return *this; } myWord = *myWordAddress++;