From: Rafael Garcia-Suarez Date: Mon, 7 Jan 2008 11:21:29 +0000 (+0000) Subject: Let's remove the grep in void context warning. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f5df47822a9b069b4d7a24dd025c8f27786c45fa;p=p5sagit%2Fp5-mst-13.2.git Let's remove the grep in void context warning. p4raw-id: //depot/perl@32888 --- diff --git a/op.c b/op.c index 212ecdd..a732aa4 100644 --- a/op.c +++ b/op.c @@ -970,7 +970,6 @@ Perl_scalarvoid(pTHX_ OP *o) case OP_ANONLIST: case OP_ANONHASH: case OP_SORT: - case OP_GREPWHILE: case OP_REVERSE: case OP_RANGE: case OP_FLIP: @@ -1011,8 +1010,7 @@ Perl_scalarvoid(pTHX_ OP *o) func_ops: if (!(o->op_private & (OPpLVAL_INTRO|OPpOUR_INTRO))) /* Otherwise it's "Useless use of grep iterator" */ - useless = (o->op_type == OP_GREPWHILE) ? "grep" - : OP_DESC(o); + useless = OP_DESC(o); break; case OP_NOT: diff --git a/t/lib/warnings/op b/t/lib/warnings/op index c201a02..f0a6e62 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -211,7 +211,6 @@ eval { getgrgid 1 }; # OP_GGRGID eval { getpwnam 1 }; # OP_GPWNAM eval { getpwuid 1 }; # OP_GPWUID prototype "foo"; # OP_PROTOTYPE -grep /42/, (1,2); # OP_GREP $a ~~ $b; # OP_SMARTMATCH $a <=> $b; # OP_NCMP EXPECT @@ -253,9 +252,8 @@ Useless use of getgrgid in void context at - line 51. Useless use of getpwnam in void context at - line 52. Useless use of getpwuid in void context at - line 53. Useless use of subroutine prototype in void context at - line 54. -Useless use of grep in void context at - line 55. -Useless use of smart match in void context at - line 56. -Useless use of numeric comparison (<=>) in void context at - line 57. +Useless use of smart match in void context at - line 55. +Useless use of numeric comparison (<=>) in void context at - line 56. ######## # op.c use warnings 'void' ; close STDIN ;