addEdges static method

void addEdges(
  1. String stringToEncode,
  2. ECIEncoderSet encoderSet,
  3. List<List<InputEdge?>> edges,
  4. int from,
  5. InputEdge? previous,
  6. int fnc1,
)

Implementation

static void addEdges(
  String stringToEncode,
  ECIEncoderSet encoderSet,
  List<List<InputEdge?>> edges,
  int from,
  InputEdge? previous,
  int fnc1,
) {
  // chr
  final ch = stringToEncode.codeUnitAt(from);

  int start = 0;
  int end = encoderSet.length;
  if (encoderSet.priorityEncoderIndex >= 0 &&
      (ch == fnc1 ||
          encoderSet.canEncode(ch, encoderSet.priorityEncoderIndex))) {
    start = encoderSet.priorityEncoderIndex;
    end = start + 1;
  }

  for (int i = start; i < end; i++) {
    if (ch == fnc1 || encoderSet.canEncode(ch, i)) {
      addEdge(edges, from + 1, InputEdge(ch, encoderSet, i, previous, fnc1));
    }
  }
}