icerpc-csharp icon indicating copy to clipboard operation
icerpc-csharp copied to clipboard

Refactor encode_action_body

Open bernardnormier opened this issue 2 years ago • 1 comments

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;

bernardnormier avatar Nov 30 '23 16:11 bernardnormier

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.

InsertCreativityHere avatar Feb 12 '24 23:02 InsertCreativityHere