This is a follow-up on bug 20186. Mostly for having something that blocks the bugs that bug 20186 (fixed in trunk, r65546) is supposed to block.
Please check the code for performance before merging – Tim suggested it might not be worse than the existing code, but let's play it safe.
Version: unspecified
Severity: enhancement