This makes a failing test pass, but also makes is_class_loaded quite a bit
slower. get_all_package_symbols needs refactoring to allow returning after it
found at least one symbol that matches the filter.
SV *klass
PREINIT:
HV *stash;
- char *key;
- I32 keylen;
- SV *gv;
+ HV *symbols;
PPCODE:
if (!SvPOK(klass) || !SvCUR(klass)) {
XSRETURN_NO;
}
}
- (void)hv_iterinit(stash);
- while ((gv = hv_iternextsv(stash, &key, &keylen))) {
- if (keylen <= 0) {
- continue;
- }
-
- if (key[keylen - 1] == ':' && key[keylen - 2] == ':') {
- continue;
- }
-
- if (!isGV(gv) || GvCV(gv)) {
- XSRETURN_YES;
- }
+ symbols = get_all_package_symbols(stash, TYPE_FILTER_CODE);
+ if (HvKEYS(symbols) > 0) {
+ SvREFCNT_dec((SV *)symbols);
+ XSRETURN_YES;
}
+ SvREFCNT_dec((SV *)symbols);
XSRETURN_NO;
MODULE = Class::MOP PACKAGE = Class::MOP::Package