Community
Participate
Working Groups
In the following example the extract local variable function does not check for all places where it could substitute. It gives up after the first substitution. Before: int asd = (a+b) * (c+d) *p; int qwe = (a+b) * (c+d) *q; int zxc = (a+b) * (c+d) *r; int rty = (a+b) * (c+d) *s; After: int a0 = (a+b) * (c+d); int asd = a0 * p; int qwe = (a+b) * (c+d) *q; int zxc = (a+b) * (c+d) *r; int rty = (a+b) * (c+d) *s; If the expression involved a call to a member function I would be quite happy to accept responsibility for ensuring that there were no side effects