parse.y (nextc0): small refactoring.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-06-08 21:59:51 +09:00
parent 0d2c550f0f
commit b1f6c856e3
2 changed files with 10 additions and 14 deletions
+5 -7
View File
@@ -4257,22 +4257,20 @@ static mrb_bool skips(parser_state *p, const char *s);
static inline int
nextc0(parser_state *p)
{
int c;
if (p->s && p->s < p->send) {
c = (unsigned char)*p->s++;
return (unsigned char)*p->s++;
}
else {
#ifndef MRB_NO_STDIO
int c;
if (p->f) {
c = fgetc(p->f);
if (feof(p->f)) return -1;
if (!feof(p->f)) return c;
}
else
#endif
return -1;
return -1;
}
return c;
}
static inline int
+5 -7
View File
@@ -10496,22 +10496,20 @@ static mrb_bool skips(parser_state *p, const char *s);
static inline int
nextc0(parser_state *p)
{
int c;
if (p->s && p->s < p->send) {
c = (unsigned char)*p->s++;
return (unsigned char)*p->s++;
}
else {
#ifndef MRB_NO_STDIO
int c;
if (p->f) {
c = fgetc(p->f);
if (feof(p->f)) return -1;
if (!feof(p->f)) return c;
}
else
#endif
return -1;
return -1;
}
return c;
}
static inline int