Skip to content

Commit 0d0ce7f

Browse files
committed
Fix JSON instance warning
Full warning: > Redundant creation of Json format. Creating instances for each usage can be slow.
1 parent 8060669 commit 0d0ce7f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

android/Gutenberg/src/main/java/org/wordpress/gutenberg/model/EditorPreloadList.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ data class EditorPreloadList private constructor(
107107
fun build(formatted: Boolean = false): String {
108108
val jsonElement = build()
109109
return if (formatted) {
110+
@Suppress("JSON_FORMAT_REDUNDANT") // This is only used in debug builds
110111
Json { prettyPrint = true }.encodeToString(jsonElement)
111112
} else {
112113
Json.encodeToString(jsonElement)

0 commit comments

Comments
 (0)