We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ec26965 commit c33fda1Copy full SHA for c33fda1
beacon_chain/spec/column_map.nim
@@ -43,8 +43,12 @@ func excl*(a: var ColumnMap, column: ColumnIndex) =
43
a.data[index].clearBit(offset)
44
45
func init*(t: typedesc[ColumnMap], columns: openArray[ColumnIndex]): ColumnMap =
46
+ ## NOTE: `columns` array's content should be checked before running this
47
+ ## function. Function will assert if `ColumnIndex >= NUMBER_OF_COLUMNS`.
48
var res: ColumnMap
49
for column in columns:
50
+ if uint64(column) >= NUMBER_OF_COLUMNS:
51
+ raiseAssert "Incorrect column index, " & $uint64(column)
52
let (index, offset) = column.getPos()
53
res.data[index].setBit(offset)
54
res
0 commit comments