Skip to content

Commit ffa677a

Browse files
committed
Avoid copying the setting
Because we know the value is not up to date and it will be updated when writing the value
1 parent ff286cf commit ffa677a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

common/src/main/kotlin/com/lambda/config/settings/collections/ListSetting.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ListSetting<T : Any>(
2121
}
2222

2323
override fun toJson(): JsonElement {
24-
value = defaultValue.toMutableList() // Hack the Delegates.observable
24+
value = defaultValue // Hack the Delegates.observable
2525
return gson.toJsonTree(value)
2626
}
2727
}

common/src/main/kotlin/com/lambda/config/settings/collections/MapSetting.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class MapSetting<K, V>(
2121
}
2222

2323
override fun toJson(): JsonElement {
24-
value = defaultValue.toMutableMap() // Hack the Delegates.observable
24+
value = defaultValue // Hack the Delegates.observable
2525
return gson.toJsonTree(value)
2626
}
2727
}

common/src/main/kotlin/com/lambda/config/settings/collections/SetSetting.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class SetSetting<T : Any>(
2121
}
2222

2323
override fun toJson(): JsonElement {
24-
value = defaultValue.toMutableSet() // Hack the Delegates.observable
24+
value = defaultValue // Hack the Delegates.observable
2525
return gson.toJsonTree(value)
2626
}
2727
}

0 commit comments

Comments
 (0)