addEdge method

void addEdge(
  1. List<List<List<Edge?>>> edges,
  2. int position,
  3. Edge edge
)

Implementation

void addEdge(List<List<List<Edge?>>> edges, int position, Edge edge) {
  final vertexIndex = position + edge.characterLength;
  final modeEdges = edges[vertexIndex][edge.charsetEncoderIndex];
  final modeOrdinal = getCompactedOrdinal(edge.mode);
  if (modeEdges[modeOrdinal] == null ||
      modeEdges[modeOrdinal]!.cachedTotalSize > edge.cachedTotalSize) {
    modeEdges[modeOrdinal] = edge;
  }
}