move msgs into AppType.app_type, and refactor AppUpdate.update function to have type (app_type -> app_type) instead of pervious case which was (app_type -> app_type * MailboxType.t list). Reason: no need to allocate/return tuple when can store messages in type directly; previous msg list will be reset after each app update. All tests after refactor are passing.
This commit is contained in:
@@ -17,8 +17,8 @@ struct
|
||||
fun loop (app: AppType.app_type, inputMailbox, drawMailbox) =
|
||||
let
|
||||
val inputMsg = Mailbox.recv inputMailbox
|
||||
val (app, msgList) = AppUpdate.update (app, inputMsg)
|
||||
val _ = sendMsgs (msgList, drawMailbox)
|
||||
val app = AppUpdate.update (app, inputMsg)
|
||||
val () = sendMsgs (#msgs app, drawMailbox)
|
||||
in
|
||||
loop (app, inputMailbox, drawMailbox)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user