Skip to content

Tighten scope on the 'formatter' variable#100

Merged
marmelroy merged 1 commit intomarmelroy:masterfrom
sweetmandm:scope-formatter-variable
Jan 23, 2017
Merged

Tighten scope on the 'formatter' variable#100
marmelroy merged 1 commit intomarmelroy:masterfrom
sweetmandm:scope-formatter-variable

Conversation

@sweetmandm
Copy link
Copy Markdown
Contributor

Why?

I'm doing parsing + e.164 formatting in a tight loop -- this extra allocation doesn't likely hurt a lot, but I figure why incur it if we don't have to?

What Changed?

Move the formatter variable creation inside the scope where it is used, so it is not created if it will not be used.

@marmelroy
Copy link
Copy Markdown
Owner

Thanks @sweetmandm. Looks good.

@marmelroy marmelroy merged commit e7731fb into marmelroy:master Jan 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants