Skip to content

Commit 5ae478b

Browse files
committed
Remove creating copy of JSON object for experiment
1 parent 2dcede9 commit 5ae478b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

firebase-config/src/main/java/com/google/firebase/remoteconfig/internal/ConfigContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ private Map<String, JSONObject> createExperimentsMap() throws JSONException {
241241
JSONArray affectedKeys = experiment.getJSONArray(AFFECTED_PARAMETER_KEYS);
242242
for (int j = 0; j < affectedKeys.length(); j++) {
243243
String key = affectedKeys.getString(j);
244-
JSONObject experimentsCopy = new JSONObject(experiment.toString());
245-
experimentsMap.put(key, experimentsCopy);
244+
// Reuse the same JSONObject instance instead of creating a copy
245+
experimentsMap.put(key, experiment);
246246
}
247247
}
248248

0 commit comments

Comments
 (0)