Handle nil tags specially to avoid slow method_missing calls. #88

Merged
merged 1 commit into from Oct 1, 2012

Projects

None yet

2 participants

@nirvdrum

Previously, the nil value would be compared to any RegExps, which causes method_missing to be invoked on nil, which is both slow and always guaranteed to fail matching against the RegExp.

@nirvdrum nirvdrum Handle nil tags specially to avoid slow method_missing calls.
Previously, the nil value would be compared to any RegExps, which causes method_missing to be invoked on nil, which is both slow and always guaranteed to fail matching against the RegExp.
85a1ae2
@tenderlove tenderlove merged commit 465ae0a into ruby:master Oct 1, 2012

1 check failed

Details default The Travis build failed
@nirvdrum

Did I get the method intent correct? It was a little hard to figure out what that block was doing. I think it's registering an empty object for the tag, so I came up with "register_empty".

@tenderlove
Ruby Programming Language member

Yes, that's exactly what it's doing. It makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment