0

in mybatis Why does multipleresults not initialize capacity? Why not initialize the capacity to avoid capacity expansion?

 final List<Object> multipleResults = new ArrayList<>();

int resultSetCount = 0;
ResultSetWrapper rsw = getFirstResultSet(stmt);

List<ResultMap> resultMaps = mappedStatement.getResultMaps();
int resultMapCount = resultMaps.size();
validateResultMapsCount(rsw, resultMapCount);
while (rsw != null && resultMapCount > resultSetCount) {
  ResultMap resultMap = resultMaps.get(resultSetCount);
  handleResultSet(rsw, resultMap, multipleResults, null);
  rsw = getNextResultSet(stmt);
  cleanUpAfterHandlingResultSet();
  resultSetCount++;
}
Lee Ge
  • 1
  • [This](https://stackoverflow.com/a/15430259/1261766) should answer your question. – ave Aug 31 '21 at 19:12

0 Answers0