Skip to content

Commit

Permalink
Write all fields on STON
Browse files Browse the repository at this point in the history
  • Loading branch information
PalumboN committed Jul 18, 2022
1 parent 6f7a710 commit da0136b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions smalltalksrc/VMMaker/ComposedImageWriter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,10 @@ ComposedImageWriter >> writePermanentSpaceMetadata: imageFileName [
ComposedImageWriter >> writeSTON: struct toFile: f [

<inline: true>
| fieldHasNilValue |

struct withStructNameDo: [ :name | self fprintf: f _: self headFormat _: name ].
struct withFieldsDo: [ :fieldName :fieldValue |
fieldValue
ifNil: [ fieldHasNilValue := true ]
ifNotNil: [
fieldHasNilValue := false.
self fprintf: f _: self fieldFormat _: fieldName _: fieldValue ]]
separatedBy: [ fieldHasNilValue ifFalse: [self fprintf: f _: ',\n'] ].
self fprintf: f _: self fieldFormat _: fieldName _: fieldValue]
separatedBy: [ self fprintf: f _: ',\n'].

self fprintf: f _: '\n}'.
]
Expand Down

0 comments on commit da0136b

Please sign in to comment.