Skip to content

Commit

Permalink
More and more small changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peanuuutz committed Oct 12, 2023
1 parent 797a21b commit eb38a41
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -552,12 +552,10 @@ private abstract class TomlFileTableLikeEncoder(
TomlFileFlowClassEncoder(this)
}
shouldStructureCurrentElement -> {
val innerPath = currentElementPath.toMutableList()
innerPath.add("")
TomlFileClassEncoder(
delegate = this,
isStructured = true,
path = innerPath,
path = currentElementPath.toMutableList().apply { add("") },
structuredTableLikeIndex = calculateStructuredTableLikeIndex(descriptor)
)
}
Expand All @@ -566,12 +564,10 @@ private abstract class TomlFileTableLikeEncoder(
TomlFileFlowClassEncoder(this)
}
else -> {
val innerPath = currentElementPath.toMutableList()
innerPath.add("")
TomlFileClassEncoder(
delegate = this,
isStructured = false,
path = innerPath,
path = currentElementPath.toMutableList().apply { add("") },
structuredTableLikeIndex = Int.MAX_VALUE
)
}
Expand Down Expand Up @@ -619,12 +615,10 @@ private abstract class TomlFileTableLikeEncoder(
TomlFileFlowMapEncoder(this, collectionSize)
}
shouldStructureCurrentElement -> {
val innerPath = currentElementPath.toMutableList()
innerPath.add("")
TomlFileMapEncoder(
delegate = this,
isStructured = true,
path = innerPath,
path = currentElementPath.toMutableList().apply { add("") },
mapSize = collectionSize,
valueDescriptor = descriptor.getElementDescriptor(1)
)
Expand All @@ -634,12 +628,10 @@ private abstract class TomlFileTableLikeEncoder(
TomlFileFlowMapEncoder(this, 0)
}
else -> {
val innerPath = currentElementPath.toMutableList()
innerPath.add("")
TomlFileMapEncoder(
delegate = this,
isStructured = false,
path = innerPath,
path = currentElementPath.toMutableList().apply { add("") },
mapSize = collectionSize,
valueDescriptor = descriptor.getElementDescriptor(1)
)
Expand Down

0 comments on commit eb38a41

Please sign in to comment.