findLabel function

List? findLabel(
  1. Uint8List l,
  2. List<List> trees
)

Implementation

List? findLabel(Uint8List l, List<List> trees) {
  if (trees.isEmpty) {
    return null;
  }
  for (var t in trees) {
    if (t[0] == NodeId.Labeled) {
      var p =
          t[1] is Uint8List ? t[1] : (t[1] as Uint8Buffer).buffer.asUint8List();
      if (u8aEq(l, p)) {
        return t[2] as List;
      }
    }
  }
}