From 5fd0076871f6dedd95fdad539e9602a3d993e4a5 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 26 Dec 2014 06:20:55 +0000 Subject: marshal.c: append at once * marshal.c (w_long): append at once by w_nbyte() instead of appending byte by byte. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- marshal.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'marshal.c') diff --git a/marshal.c b/marshal.c index 6a61ae53b4..43886c4daa 100644 --- a/marshal.c +++ b/marshal.c @@ -277,7 +277,7 @@ static void w_long(long x, struct dump_arg *arg) { char buf[sizeof(long)+1]; - int i, len = 0; + int i; #if SIZEOF_LONG > 4 if (!(RSHIFT(x, 31) == 0 || RSHIFT(x, 31) == -1)) { @@ -310,10 +310,7 @@ w_long(long x, struct dump_arg *arg) break; } } - len = i; - for (i=0;i<=len;i++) { - w_byte(buf[i], arg); - } + w_nbyte(buf, i+1, arg); } #ifdef DBL_MANT_DIG -- cgit v1.2.3