develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35141 - trunk/languages/befunge

From:
jquelin
Date:
January 7, 2009 09:30
Subject:
[svn:parrot] r35141 - trunk/languages/befunge
Message ID:
20090107173029.0D5BFCB9FA@x12.develooper.com
Author: jquelin
Date: Wed Jan  7 09:30:28 2009
New Revision: 35141

Modified:
   trunk/languages/befunge/load.pir

Log:
simplify padding


Modified: trunk/languages/befunge/load.pir
==============================================================================
--- trunk/languages/befunge/load.pir	(original)
+++ trunk/languages/befunge/load.pir	Wed Jan  7 09:30:28 2009
@@ -62,15 +62,8 @@
     .param string str
 
     # padding with spaces to 80 chars if needed
-    .local int i, len
-    len = length str
-    i   = 80 - len
-  _LOAD__FIT_STR_TO_80__PADDING:
-    if i <= 0 goto _LOAD__FIT_STR_TO_80__PADDED
-    dec i
-    concat str, ' '
-    goto _LOAD__FIT_STR_TO_80__PADDING
-  _LOAD__FIT_STR_TO_80__PADDED:
+    $S0 = repeat ' ', 80
+    concat str, $S0
 
     # truncate to 80 chars
     substr str, 80, -1, ''



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About