File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
api/src/main/java/org/asynchttpclient/oauth Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,11 @@ else if (scheme.equals("https"))
122122 * List of all query and form parameters added to this request; needed
123123 * for calculating request signature
124124 */
125- OAuthParameterSet allParameters = new OAuthParameterSet ();
125+ int allParametersSize = 5
126+ + (userAuth .getKey () != null ? 1 : 0 )
127+ + (formParams != null ? formParams .size () : 0 )
128+ + (queryParams != null ? queryParams .size () : 0 );
129+ OAuthParameterSet allParameters = new OAuthParameterSet (allParametersSize );
126130
127131 // start with standard OAuth parameters we need
128132 allParameters .add (KEY_OAUTH_CONSUMER_KEY , consumerAuth .getKey ());
@@ -203,9 +207,10 @@ protected long generateTimestamp() {
203207 * when it would occur it'd be harder to track down.
204208 */
205209 final static class OAuthParameterSet {
206- final private ArrayList <Parameter > allParameters = new ArrayList <>() ;
210+ private final ArrayList <Parameter > allParameters ;
207211
208- public OAuthParameterSet () {
212+ public OAuthParameterSet (int size ) {
213+ allParameters = new ArrayList <>(size );
209214 }
210215
211216 public OAuthParameterSet add (String key , String value ) {
You can’t perform that action at this time.
0 commit comments