зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
993f22cb1b
Коммит
5fd0076871
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Dec 26 15:20:54 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* marshal.c (w_long): append at once by w_nbyte() instead of
|
||||||
|
appending byte by byte.
|
||||||
|
|
||||||
Fri Dec 26 15:13:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Dec 26 15:13:13 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/json/parser/parser.rl (unescape_unicode): check if valid
|
* ext/json/parser/parser.rl (unescape_unicode): check if valid
|
||||||
|
|
|
@ -277,7 +277,7 @@ static void
|
||||||
w_long(long x, struct dump_arg *arg)
|
w_long(long x, struct dump_arg *arg)
|
||||||
{
|
{
|
||||||
char buf[sizeof(long)+1];
|
char buf[sizeof(long)+1];
|
||||||
int i, len = 0;
|
int i;
|
||||||
|
|
||||||
#if SIZEOF_LONG > 4
|
#if SIZEOF_LONG > 4
|
||||||
if (!(RSHIFT(x, 31) == 0 || RSHIFT(x, 31) == -1)) {
|
if (!(RSHIFT(x, 31) == 0 || RSHIFT(x, 31) == -1)) {
|
||||||
|
@ -310,10 +310,7 @@ w_long(long x, struct dump_arg *arg)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
len = i;
|
w_nbyte(buf, i+1, arg);
|
||||||
for (i=0;i<=len;i++) {
|
|
||||||
w_byte(buf[i], arg);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DBL_MANT_DIG
|
#ifdef DBL_MANT_DIG
|
||||||
|
|
Загрузка…
Ссылка в новой задаче