-
Notifications
You must be signed in to change notification settings - Fork 586
App state32 #17462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: brian/increment-versions
Are you sure you want to change the base?
App state32 #17462
Conversation
!ci-build-me |
!ci-build-me |
@@ -70,7 +70,7 @@ module Account_update_under_construction = struct | |||
type t = { app_state : Field.t option Zkapp_state.V.t } | |||
|
|||
let create () = | |||
{ app_state = [ None; None; None; None; None; None; None; None ] } | |||
{ app_state = Mina_base.Zkapp_state.V.init ~f:(fun _ -> None) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: ~f:(const None)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❯rg -t ml 'fun _ ->' | wc -l
330
rg -t ml 'const ' | wc -l
224
It looks like we use a mix of the two 😢
I don't feel strongly, I'm happy to use const here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, they are slightly different in that const a
always evaluate eagerly, while fun _ -> a
does not.
But for sure compiler may optimize them into the samething
{ app_state = [ Keep; Keep; Keep; Keep; Keep; Keep; Keep; Keep ] | ||
{ app_state = | ||
Mina_base.Zkapp_state.V.init ~f:(fun _ -> | ||
Zkapp_basic.Set_or_keep.Keep ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use const
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
Explain your changes:
Explain how you tested your changes:
*no additional tests
Checklist: