cvs: pecl /apc apc_optimizer.c
| From: | George Schlossnagle | Date: | Mon, 23 Jun 2003 17:59:48 +0000 |
| Subject: | cvs: pecl /apc apc_optimizer.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-294@lists.php.net to get a copy of this message | ||
gschlossnagle Mon Jun 23 13:59:48 2003 EDT
Modified files:
/pecl/apc apc_optimizer.c
Log:
improved string interpolation optimization a bit.
Index: pecl/apc/apc_optimizer.c
diff -u pecl/apc/apc_optimizer.c:3.7 pecl/apc/apc_optimizer.c:3.8
--- pecl/apc/apc_optimizer.c:3.7 Mon Jun 23 00:05:47 2003
+++ pecl/apc/apc_optimizer.c Mon Jun 23 13:59:47 2003
@@ -239,9 +239,18 @@
assert(pair_length(p) >= 2);
for (p = cdr(p); p; p = cdr(p)) {
- concat_function(&ops[car(p)].op2.u.constant,
- &ops[car(p)].op2.u.constant,
- &ops[curr].op2.u.constant);
+ switch (ops[curr].opcode) {
+ case ZEND_ADD_STRING:
+ add_string_to_string(&ops[car(p)].op2.u.constant,
+ &ops[car(p)].op2.u.constant,
+ &ops[curr].op2.u.constant);
+ break;
+ case ZEND_ADD_CHAR:
+ add_char_to_string(&ops[car(p)].op2.u.constant,
+ &ops[car(p)].op2.u.constant,
+ &ops[curr].op2.u.constant);
+ break;
+ }
clear_zend_op(ops + curr);
curr = car(p);
}
@@ -519,7 +528,7 @@
tmp_var_op1 = ops[i].op1.u.var;
for (j = next_op(ops, i, num_ops); j < num_ops; j = next_op(ops, j, num_ops)) {
- if (ops[j].opcode != ZEND_ADD_STRING) {
+ if (ops[j].opcode != ZEND_ADD_STRING && ops[j].opcode != ZEND_ADD_CHAR) {
return p;
}