File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -179,8 +179,9 @@ public struct BitBlob (size_t Bits)
179179 assert (hexstr.length == (Width * 2 ), ErrorMsg);
180180
181181 auto range = hexstr.byChar.map! (std.ascii.toLower ! (char ));
182- foreach (size_t idx, chunk; range.map! (fromHex).chunks(2 ).retro.enumerate)
183- this .data[idx] = cast (ubyte )((chunk[0 ] << 4 ) + chunk[1 ]);
182+ size_t idx;
183+ foreach (chunk; range.map! (fromHex).chunks(2 ).retro)
184+ this .data[idx++ ] = cast (ubyte )((chunk[0 ] << 4 ) + chunk[1 ]);
184185 }
185186
186187 /* **************************************************************************
@@ -351,6 +352,13 @@ unittest
351352 assert (collectException! AssertError (Hash(buff)) ! is null );
352353}
353354
355+ // Make sure the string parsing works at CTFE
356+ unittest
357+ {
358+ static immutable BitBlob! 256 CTFEability = BitBlob! 256 (GenesisBlockHashStr);
359+ static assert (CTFEability[] == GenesisBlockHash);
360+ }
361+
354362version (unittest )
355363{
356364private :
You can’t perform that action at this time.
0 commit comments