From 94d80c53d196e34cf8b3da0c4904fd9242945990 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sat, 7 Jul 2012 11:42:30 -0600 Subject: [PATCH] regcomp.c: Delay some initialization until needed This delays the initialization of the bitmap in ANYOF nodes until just before it is needed, and to after where we make a decision to optimize that node to a node which takes less space. Currently, the space is not given up, once reserved in pass 1, so the write is harmless. This will allow a future commit to shrink the space. --- regcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regcomp.c b/regcomp.c index 2e23fa9..d5d1cb9 100644 --- a/regcomp.c +++ b/regcomp.c @@ -11155,7 +11155,6 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, U32 depth) if (LOC) { ANYOF_FLAGS(ret) |= ANYOF_LOCALE; } - ANYOF_BITMAP_ZERO(ret); listsv = newSVpvs("# comment\n"); initial_listsv_len = SvCUR(listsv); } @@ -12315,6 +12314,7 @@ parseit: * compile time that match under all conditions. Go through it, and * for things that belong in the bitmap, put them there, and delete from * */ + ANYOF_BITMAP_ZERO(ret); if (cp_list) { /* This gets set if we actually need to modify things */ -- 2.7.4