libp2p/utils/collections

Search:
Group by:
Source   Edit  

Procs

proc capLen[T](s: var seq[T]; length: int) {....raises: [].}
Source   Edit  
proc take[T](s: seq[T]; n: int): seq[T] {....raises: [].}
Take first n elements of s, or s.len() if n > s.len() Source   Edit  
proc toChunks[T](data: seq[T]; size: int): seq[seq[T]] {....raises: [], raises: [].}
Splits data into chunks of length size. The last chunk may be smaller if data.len is not divisible by size. Source   Edit  

Templates

template exclIfIt[T](set: var HashSet[T]; condition: untyped) {..}
Source   Edit  
template filterIt[T](set: HashSet[T]; condition: untyped): HashSet[T] {..}
Source   Edit