icerpc-csharp
icerpc-csharp copied to clipboard
Refactor encode_action_body
This code: https://github.com/icerpc/icerpc-csharp/blob/b06a0d078a3d8e929873592d6159ac6326571308/tools/slicec-cs/src/encoding.rs#L349
should be simplified. It's confusing to compute value and then most of the time not use it but instead hardcode "value".
It would be nice to add some comments too. For example, explain why we create this strange helper variable:
let is_optional = type_ref.is_optional && !is_tagged;
This function got some simplification in #3916. There is still more opportunity for simplification, but it would require untangling the other functions that call into it first.