ListUtils

io.joern.x2cpg.utils.ListUtils
object ListUtils

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
ListUtils.type

Members list

Extensions

Extensions

extension [T](list: List[T])
def takeUntil(predicate: T => Boolean): List[T]

Return each element in the list up to and including the first element which satisfies the given predicate, or return the empty list if no matching element is found, e.g.

Return each element in the list up to and including the first element which satisfies the given predicate, or return the empty list if no matching element is found, e.g.

List(1, 2, 3, 4, 1, 2).takeUntil(_ >= 3) => List(1, 2, 3)

List(1, 2, 3, 4, 1, 2).takeUntil(_ >= 5) => Nil

Attributes