From f798caf9fb53411aa2c5268878e36cd87894b2c3 Mon Sep 17 00:00:00 2001 From: Djomanix Date: Thu, 12 Jun 2014 11:16:52 -0400 Subject: [PATCH] Deleted useless 'while' and inlined write method Signed-off-by: Djomanix --- lib/pnacl.nit | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/pnacl.nit b/lib/pnacl.nit index a63e7ca..8f50fa1 100644 --- a/lib/pnacl.nit +++ b/lib/pnacl.nit @@ -307,17 +307,14 @@ module pnacl is platform /* This function is called by Nit when using check_dictionary, returns the dictionary at the head of the queue. */ void* NitHandleDictionary() { - while(1) { - struct PP_Var dictionary = DequeueDictionary(); - PnaclApp_handle_dictionary(app, &dictionary); - } + struct PP_Var dictionary = DequeueDictionary(); + PnaclApp_handle_dictionary(app, &dictionary); + return 0; } /* This function is called By Nit when waiting for a user input. */ char* NitHandleMessage() { - while(1) { - return DequeueMessage(); - } + return DequeueMessage(); } /* Entry point */ @@ -637,11 +634,8 @@ class PnaclStream redef fun eof do return end_reached - # write method sends now a message to JS. - redef fun write(s: Text) - do - app.post_message s.to_s - end + # Redefintion of 'write' to send messages to the browser. + redef fun write(s: Text) do app.post_message s.to_s redef fun is_writable: Bool do return true -- 1.7.9.5