зеркало из https://github.com/github/ruby.git
[ruby/date] Remove `extz_pats` table
https://github.com/ruby/date/commit/945e26e243
This commit is contained in:
Родитель
70c905963e
Коммит
49dc424ff3
|
@ -18,12 +18,6 @@ static const char *month_names[] = {
|
||||||
"October", "November", "December",
|
"October", "November", "December",
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *extz_pats[] = {
|
|
||||||
":z",
|
|
||||||
"::z",
|
|
||||||
":::z"
|
|
||||||
};
|
|
||||||
|
|
||||||
#define sizeof_array(o) (sizeof o / sizeof o[0])
|
#define sizeof_array(o) (sizeof o / sizeof o[0])
|
||||||
|
|
||||||
#define f_negate(x) rb_funcall(x, rb_intern("-@"), 0)
|
#define f_negate(x) rb_funcall(x, rb_intern("-@"), 0)
|
||||||
|
@ -185,10 +179,9 @@ date__strptime_internal(const char *str, size_t slen,
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < (int)sizeof_array(extz_pats); i++)
|
for (i = 1; i < 3 && fi + i < flen && fmt[fi+i] == ':'; ++i);
|
||||||
if (strncmp(extz_pats[i], &fmt[fi],
|
if (fmt[fi+i] == 'z') {
|
||||||
strlen(extz_pats[i])) == 0) {
|
fi += i - 1;
|
||||||
fi += i;
|
|
||||||
goto again;
|
goto again;
|
||||||
}
|
}
|
||||||
fail();
|
fail();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче