Skip to content

Commit

Permalink
Converted single-element arraylist into singleton list. (#271)
Browse files Browse the repository at this point in the history
* Converted single-element arraylist into singleton list.

Should have modest memory benefits.

* Updated PR per review comment.
  • Loading branch information
autonomousapps authored and serggl committed Jun 2, 2017
1 parent 78b57d9 commit d9f4dfa
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.UUID;
Expand Down Expand Up @@ -377,8 +378,7 @@ public boolean updateSubscription(Activity activity, String oldProductId, String
List<String> oldProductIds = null;
if (!TextUtils.isEmpty(oldProductId))
{
oldProductIds = new ArrayList<>(1);
oldProductIds.add(oldProductId);
oldProductIds = Collections.singletonList(oldProductId);
}
return updateSubscription(activity, oldProductIds, productId);
}
Expand Down

0 comments on commit d9f4dfa

Please sign in to comment.