Skip to content

Commit

Permalink
why was i doing this from xs to begin with
Browse files Browse the repository at this point in the history
  • Loading branch information
doy committed Jun 23, 2012
1 parent 2e70e3d commit 35660a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
4 changes: 2 additions & 2 deletions lib/smartmatch.pm
Expand Up @@ -72,11 +72,11 @@ sub import {
unless $package->can('match');
}

register($engine);
$^H{'smartmatch/engine'} = $engine;
}

sub unimport {
unregister();
delete $^H{'smartmatch/engine'};
}

=head1 BUGS
Expand Down
25 changes: 0 additions & 25 deletions smartmatch.xs
Expand Up @@ -120,28 +120,3 @@ PROTOTYPES: DISABLE

BOOT:
hook_op_check_smartmatch();

void
register (engine)
SV *engine;
CODE:
if (SvROK(engine)) {
croak("not an engine name");
}

PL_hints |= HINT_LOCALIZE_HH;
gv_HVadd(PL_hintgv);

SvREFCNT_inc(engine);
if (!hv_stores(GvHV(PL_hintgv), SMARTMATCH_HH_KEY, engine)) {
SvREFCNT_dec(engine);
croak("couldn't store the engine");
}

void
unregister ()
CODE:
PL_hints |= HINT_LOCALIZE_HH;
gv_HVadd(PL_hintgv);

hv_delete(GvHV(PL_hintgv), SMARTMATCH_HH_KEY, 17, G_DISCARD);

0 comments on commit 35660a6

Please sign in to comment.