You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several type assertions in decode.go are not needed because they immediately follow a function that returns the desired type.
And decodeBig has obsolete code for v1 compatibility.
Suggestion
Remove type assertions that immediately follow a function call that returns the desired type.
Remove the obsolete code in decodeBig. The code was made obsolete by the recent decision to remove backward compatible decoding from the upcoming v4 decoder.
Context
Removal of these code blocks do not change v4 storage format.
Preliminary benchmark comparisons show speed gains of 3-4% decoding a 167 byte CBOR LinkValue.
Indirectly updates #738 because this was discovered while reviewing code to prepare for finalization of v4 storage format.
The text was updated successfully, but these errors were encountered:
fxamacker
changed the title
Redundant code and obsolete code in decode.go can be removed
Unneeded type assertion and obsolete code in decode.go can be removed
Apr 9, 2021
fxamacker
added a commit
to fxamacker/cadence
that referenced
this issue
Apr 9, 2021
Issue To Be Solved
Several type assertions in decode.go are not needed because they immediately follow a function that returns the desired type.
And
decodeBig
has obsolete code for v1 compatibility.Suggestion
Remove type assertions that immediately follow a function call that returns the desired type.
Remove the obsolete code in
decodeBig
. The code was made obsolete by the recent decision to remove backward compatible decoding from the upcoming v4 decoder.Context
Removal of these code blocks do not change v4 storage format.
Preliminary benchmark comparisons show speed gains of 3-4% decoding a 167 byte CBOR LinkValue.
Indirectly updates #738 because this was discovered while reviewing code to prepare for finalization of v4 storage format.
The text was updated successfully, but these errors were encountered: