cvsuser 04/10/19 11:56:24
Modified: classes pmc2c2.pl
Log:
A more efficient idiom for counting single characters.
Revision Changes Path
1.20 +2 -2 parrot/classes/pmc2c2.pl
Index: pmc2c2.pl
===================================================================
RCS file: /cvs/public/parrot/classes/pmc2c2.pl,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -r1.19 -r1.20
--- pmc2c2.pl 18 Oct 2004 22:07:20 -0000 1.19
+++ pmc2c2.pl 19 Oct 2004 18:56:23 -0000 1.20
@@ -1,6 +1,6 @@
#! perl -w
# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-# $Id: pmc2c2.pl,v 1.19 2004/10/18 22:07:20 dan Exp $
+# $Id: pmc2c2.pl,v 1.20 2004/10/19 18:56:23 nicholas Exp $
=head1 NAME
@@ -299,7 +299,7 @@
}
sub count_newlines {
- return scalar(() = $_[0] =~ /\n/g);
+ return scalar $_[0] =~ tr/\n//;
}
sub extract_balanced {