mirror of
https://github.com/yasm/yasm
synced 2026-08-26 22:26:05 -04:00
Optimize matching loops.
Reported by: Po-Chun Chang [#264 state:resolved] [#265 state:resolved] [#266 state:resolved]
This commit is contained in:
parent
d8c0c39254
commit
964fd9a016
3 changed files with 15 additions and 4 deletions
|
|
@ -448,9 +448,14 @@ do_assemble(void)
|
|||
*/
|
||||
matched = 0;
|
||||
for (i=0; cur_parser_module->preproc_keywords[i]; i++)
|
||||
{
|
||||
if (yasm__strcasecmp(cur_parser_module->preproc_keywords[i],
|
||||
cur_preproc_module->keyword) == 0)
|
||||
cur_preproc_module->keyword) == 0) {
|
||||
matched = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!matched) {
|
||||
print_error(_("%s: `%s' is not a valid %s for %s `%s'"), _("FATAL"),
|
||||
cur_preproc_module->keyword, _("preprocessor"),
|
||||
|
|
|
|||
|
|
@ -87,8 +87,10 @@ yasm__assoc_data_add(yasm__assoc_data *assoc_data_arg,
|
|||
|
||||
/* See if there's already assocated data for this callback */
|
||||
for (i=0; i<assoc_data->size; i++) {
|
||||
if (assoc_data->vector[i].callback == callback)
|
||||
if (assoc_data->vector[i].callback == callback) {
|
||||
item = &assoc_data->vector[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* No? Then append a new one */
|
||||
|
|
|
|||
|
|
@ -261,10 +261,14 @@ yasm_object_create(const char *src_filename, const char *obj_filename,
|
|||
* for the active object format.
|
||||
*/
|
||||
matched = 0;
|
||||
for (i=0; objfmt_module->dbgfmt_keywords[i]; i++)
|
||||
for (i=0; objfmt_module->dbgfmt_keywords[i]; i++) {
|
||||
if (yasm__strcasecmp(objfmt_module->dbgfmt_keywords[i],
|
||||
dbgfmt_module->keyword) == 0)
|
||||
dbgfmt_module->keyword) == 0) {
|
||||
matched = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!matched) {
|
||||
yasm_error_set(YASM_ERROR_GENERAL,
|
||||
N_("`%s' is not a valid debug format for object format `%s'"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue