Skip to content

Commit

Permalink
Remove obsoleted checks/comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jobarr-amzn committed Oct 31, 2024
1 parent 522df62 commit fa2e0fb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/main/java/com/amazon/ion/impl/bin/IonManagedWriter_1_1.kt
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,6 @@ internal class IonManagedWriter_1_1(

// Only called by `finish()`
private fun resetEncodingContext() {
// TODO: Make sure that if a value is written after this method is called, we
// emit an IVM or empty encoding directive before the next user value
// in order to avoid writing a data stream with leaky context.
if (depth != 0) throw IllegalStateException("Cannot reset the encoding context while stepped in any value.")
symbolTable.clear()
macroNames.clear()
Expand Down Expand Up @@ -318,7 +315,7 @@ internal class IonManagedWriter_1_1(
val macro = if (!hasSymbolsToRetain) SystemMacro.SetSymbols else SystemMacro.AddSymbols

// Add new symbols
if (hasSymbolsToAdd) writeSystemMacro(macro) {
writeSystemMacro(macro) {
stepInExpressionGroup(usingLengthPrefix = false)
if (newSymbols.size <= MAX_SYMBOLS_IN_SINGLE_LINE_SYMBOL_TABLE) forceNoNewlines(true)
newSymbols.forEach { (text, _) -> writeString(text) }
Expand All @@ -339,7 +336,7 @@ internal class IonManagedWriter_1_1(

val macro = if (!hasMacrosToRetain) SystemMacro.SetMacros else SystemMacro.AddMacros

if (hasMacrosToAdd) writeSystemMacro(macro) {
writeSystemMacro(macro) {
forceNoNewlines(false)
stepInExpressionGroup(usingLengthPrefix = false)
newMacros.forEach { (macro, address) ->
Expand Down

0 comments on commit fa2e0fb

Please sign in to comment.