Skip to content

Commit

Permalink
DRY a bit Parrot_cx_add_handler_local
Browse files Browse the repository at this point in the history
  • Loading branch information
NotFound committed Jan 24, 2011
1 parent 00cadd1 commit 4fe94e4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/scheduler.c
Expand Up @@ -489,11 +489,12 @@ void
Parrot_cx_add_handler_local(PARROT_INTERP, ARGIN(PMC *handler))
{
ASSERT_ARGS(Parrot_cx_add_handler_local)
if (PMC_IS_NULL(Parrot_pcc_get_handlers(interp, interp->ctx)))
Parrot_pcc_set_handlers(interp, interp->ctx, Parrot_pmc_new(interp,
enum_class_ResizablePMCArray));

VTABLE_unshift_pmc(interp, Parrot_pcc_get_handlers(interp, interp->ctx), handler);
PMC *handlers = Parrot_pcc_get_handlers(interp, interp->ctx);
if (PMC_IS_NULL(handlers)) {
handlers = Parrot_pmc_new(interp, enum_class_ResizablePMCArray);
Parrot_pcc_set_handlers(interp, interp->ctx, handlers);
}
VTABLE_unshift_pmc(interp, handlers, handler);

}

Expand Down

0 comments on commit 4fe94e4

Please sign in to comment.