Skip to content

Commit 1349e0f

Browse files
luzhixing12345sjp38
authored andcommitted
Optimize Memory Region Search with Break
A pattern corresponds to only one area of memory region. So if match the corresponding region name, there's no need to check for others. Signed-off-by: luzhixing12345 <[email protected]>
1 parent 4b9bded commit 1349e0f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

masim.c

+1
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ int parse_phase(char *lines[], int nr_lines, struct phase *p,
513513
for (k = 0; k < nr_regions; k++) {
514514
if (strcmp(fields[0], regions[k].name) == 0) {
515515
a->mregion = &regions[k];
516+
break;
516517
}
517518
}
518519
if (a->mregion == NULL)

0 commit comments

Comments
 (0)