Skip to content

Commit

Permalink
Minor optimisation to Compass MAK
Browse files Browse the repository at this point in the history
Use nextch_handling_eol() instead of just nextch() when moving past
the command-terminating semicolon, since there's almost always an
end of line there.
  • Loading branch information
ojwb committed Feb 26, 2024
1 parent f807847 commit ac20933
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/datain.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ data_file(const char *pth, const char *fnm)
skipblanks();
utm_zone = read_int(-60, 60);
skipblanks();
if (ch == ';') nextch();
if (ch == ';') nextch_handling_eol();

update_proj_str:
if (!pcs->next || pcs->proj_str != pcs->next->proj_str)
Expand Down Expand Up @@ -933,7 +933,7 @@ data_file(const char *pth, const char *fnm)
if (!isBlank(ch)) datum_len = c;
nextch();
}
if (ch == ';') nextch();
if (ch == ';') nextch_handling_eol();
/* FIXME: Handle other datums */
/* Also seen: North American 1927 */
/* Other valid values from docs:
Expand Down Expand Up @@ -966,7 +966,7 @@ data_file(const char *pth, const char *fnm)
s_catchar(&path, &path_len, (char)ch);
nextch();
}
if (ch == ';') nextch();
if (ch == ';') nextch_handling_eol();
break;
}
case ']': {
Expand All @@ -981,7 +981,7 @@ data_file(const char *pth, const char *fnm)
osfree(p);
nextch();
skipblanks();
if (ch == ';') nextch();
if (ch == ';') nextch_handling_eol();
break;
}
default:
Expand Down

0 comments on commit ac20933

Please sign in to comment.