summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-08-31 01:40:27 -0400
committerFather Chrysostomos <sprout@cpan.org>2014-10-24 20:36:34 -0700
commit4e0ef34209f54db7b7567b4768de7318aaf800cd (patch)
tree95534e47cdc4e21342585df6e9464fd0d93f0636 /perlio.c
parentce409cc88cd7e9921c410d37ca33d12e05a50aa1 (diff)
downloadperl-4e0ef34209f54db7b7567b4768de7318aaf800cd.tar.gz
cleanup perlio.c and doio.c
IoIFP will be assigned to again in say_false block. This redundant code is from commit 6e21c824d9 perl 4.0 patch 6. in PerlIO_allocate replace a duplicate block with a goto in PerlIO_resolve_layers replace a func call with a macro, this couldn't have been using magic due to the previous SvROK
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/perlio.c b/perlio.c
index 19b73abee5..b0a42c89a9 100644
--- a/perlio.c
+++ b/perlio.c
@@ -477,10 +477,7 @@ PerlIO_allocate(pTHX)
last = (PerlIOl **) (f);
for (i = 1; i < PERLIO_TABLE_SIZE; i++) {
if (!((++f)->next)) {
- f->flags = 0; /* lockcnt */
- f->tab = NULL;
- f->head = f;
- return (PerlIO *)f;
+ goto good_exit;
}
}
}
@@ -489,6 +486,8 @@ PerlIO_allocate(pTHX)
return NULL;
}
*last = (PerlIOl*) f++;
+
+ good_exit:
f->flags = 0; /* lockcnt */
f->tab = NULL;
f->head = f;
@@ -1459,7 +1458,7 @@ PerlIO_resolve_layers(pTHX_ const char *layers,
* If it is a reference but not an object see if we have a handler
* for it
*/
- if (SvROK(arg) && !sv_isobject(arg)) {
+ if (SvROK(arg) && !SvOBJECT(SvRV(arg))) {
PerlIO_funcs * const handler = PerlIO_layer_from_ref(aTHX_ SvRV(arg));
if (handler) {
def = PerlIO_list_alloc(aTHX);