Skip to content

Commit

Permalink
[oo] Reduced the number of PMCs created in Parrot_ComputeMRO_C3, whic…
Browse files Browse the repository at this point in the history
…h is a

modest optimization.

git-svn-id: https://svn.parrot.org/parrot/trunk@38476 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
chromatic committed May 5, 2009
1 parent 8412bea commit 65b251a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/oo.c
Expand Up @@ -1101,7 +1101,7 @@ Parrot_ComputeMRO_C3(PARROT_INTERP, ARGIN(PMC *_class))
{
ASSERT_ARGS(Parrot_ComputeMRO_C3)
PMC *result;
PMC * const merge_list = pmc_new(interp, enum_class_ResizablePMCArray);
PMC *merge_list = PMCNULL;
PMC *immediate_parents;
int i, parent_count;

Expand Down Expand Up @@ -1131,6 +1131,10 @@ Parrot_ComputeMRO_C3(PARROT_INTERP, ARGIN(PMC *_class))
if (PMC_IS_NULL(lin))
return PMCNULL;

/* instantiated lazily */
if (PMC_IS_NULL(merge_list))
merge_list = pmc_new(interp, enum_class_ResizablePMCArray);

VTABLE_push_pmc(interp, merge_list, lin);
}

Expand Down

0 comments on commit 65b251a

Please sign in to comment.