Skip to content

Commit

Permalink
change an Aristo function name to avoid Nim stdlib ambiguity (#2240)
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec committed May 29, 2024
1 parent eaf3d98 commit c466edf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions nimbus/db/aristo/aristo_journal/journal_scheduler.nim
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func fifoDel(
# Delete all available
return (@[(QueueID(1), fifo[1]), (fifo[0], wrap)], ZeroQidPair)

func capacity(
func volumeSize(
ctx: openArray[tuple[size, width: int]]; # Schedule layout
): tuple[maxQueue: int, minCovered: int, maxCovered: int] =
## Number of maximally stored and covered queued entries for the argument
Expand All @@ -262,20 +262,20 @@ func capacity(
# Public functions
# ------------------------------------------------------------------------------

func capacity*(
func volumeSize*(
ctx: openArray[tuple[size, width, wrap: int]]; # Schedule layout
): tuple[maxQueue: int, minCovered: int, maxCovered: int] =
## Variant of `capacity()`.
ctx.toSeq.mapIt((it[0],it[1])).capacity
## Variant of `volumeSize()`.
ctx.toSeq.mapIt((it[0],it[1])).volumeSize

func capacity*(
func volumeSize*(
journal: QidSchedRef; # Cascaded fifos descriptor
): tuple[maxQueue: int, minCovered: int, maxCovered: int] =
## Number of maximally stored and covered queued entries for the layout of
## argument `journal`. The resulting value of `maxQueue` entry is the maximal
## number of database slots needed, the `minCovered` and `maxCovered` entry
## indicate the rancge of the backlog foa a fully populated database.
journal.ctx.q.toSeq.mapIt((it[0].int,it[1].int)).capacity()
journal.ctx.q.toSeq.mapIt((it[0].int,it[1].int)).volumeSize()


func addItem*(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_aristo/test_helpers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const
[(2,0,high int),(1,1,high int),(1,1,high int),(1,1,high int)],
]

LyoSamples* = samples.mapIt((it, (3 * it.capacity.minCovered) div 2))
LyoSamples* = samples.mapIt((it, (3 * it.volumeSize.minCovered) div 2))

# ------------------------------------------------------------------------------
# Private helpers
Expand Down
2 changes: 1 addition & 1 deletion tests/test_aristo/test_misc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ proc testQidScheduler*(

if debug:
noisy.say "***", "sampleSize=", sampleSize,
" ctx=", ctx, " stats=", scd.capacity()
" ctx=", ctx, " stats=", scd.volumeSize()

for n in 1 .. sampleSize:
let w = scd.addItem()
Expand Down

0 comments on commit c466edf

Please sign in to comment.