Skip to content

Commit c2466ee

Browse files
monojenkinsvargaz
andauthored
[runtime] Fix a problem with PR mono/mono#19361. (#34299)
<!-- Thank you for your Pull Request! If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed. Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number --> Co-authored-by: vargaz <vargaz@users.noreply.github.com>
1 parent c74407f commit c2466ee

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/mono/mono/metadata/metadata.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3379,17 +3379,20 @@ MonoImageSet *
33793379
mono_metadata_merge_image_sets (MonoImageSet *set1, MonoImageSet *set2)
33803380
{
33813381
MonoImage **images = g_newa (MonoImage*, set1->nimages + set2->nimages);
3382+
3383+
/* Add images from set1 */
33823384
memcpy (images, set1->images, sizeof (MonoImage*) * set1->nimages);
33833385

33843386
int nimages = set1->nimages;
33853387
// FIXME: Quaratic
3386-
for (int i = 0; i < set1->nimages; ++i) {
3388+
/* Add images from set2 */
3389+
for (int i = 0; i < set2->nimages; ++i) {
33873390
int j;
3388-
for (j = 0; j < set2->nimages; ++j) {
3389-
if (set1->images [i] == set2->images [j])
3391+
for (j = 0; j < set1->nimages; ++j) {
3392+
if (set2->images [i] == set1->images [j])
33903393
break;
33913394
}
3392-
if (j == set2->nimages)
3395+
if (j == set1->nimages)
33933396
images [nimages ++] = set2->images [i];
33943397
}
33953398
return get_image_set (images, nimages);

0 commit comments

Comments
 (0)