code: void initInputsByIdMap() {
      inputsById.clear();
      for (CompilerInput input : externs) {
        InputId id = input.getInputId();
        CompilerInput previous = putCompilerInput(id, input);
        if (previous != null) {
          report(JSError.make(DUPLICATE_EXTERN_INPUT, input.getName()));
        }
      }
      for (CompilerInput input : moduleGraph.getAllInputs()) {
        InputId id = input.getInputId();
        CompilerInput previous = putCompilerInput(id, input);
        if (previous != null) {
          report(JSError.make(DUPLICATE_INPUT, input.getName()));
        }
      }
    }
docs: Creates a map to make looking up an input by name fast. Also checks for
  duplicate inputs.