Browse files

Don't provide an initial capacity to the array list by using total_ro…

…ws, since it indicates the total row in a view, not the result.
  • Loading branch information...
1 parent 67bcb4b commit 6fed3ee38481764ac713229fa08e8a34a15204ca @pgelinas pgelinas committed Dec 12, 2012
Showing with 1 addition and 5 deletions.
  1. +1 −5 org.ektorp/src/main/java/org/ektorp/impl/QueryResultParser.java
View
6 org.ektorp/src/main/java/org/ektorp/impl/QueryResultParser.java
@@ -67,11 +67,7 @@ public void parseResult(InputStream json) throws IOException {
} else if(TOTAL_ROWS_FIELD_NAME.equals(currentName)){
totalRows = jp.getIntValue();
} else if (ROWS_FIELD_NAME.equals(currentName)){
- if(totalRows == -1){
- rows = new ArrayList<T>();
- }else{
- rows = new ArrayList<T>(totalRows);
- }
+ rows = new ArrayList<T>();
parseRows(jp);
}else{
// Handle cloudant errors.

0 comments on commit 6fed3ee

Please sign in to comment.