Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release the StringBuilder back to the StringBuilderCache. #2277

Merged
merged 1 commit into from Jul 8, 2015

Conversation

@AustinWise
Copy link
Collaborator

@AustinWise AustinWise commented Jul 8, 2015

Fixes #2275

@dnfclas
Copy link

@dnfclas dnfclas commented Jul 8, 2015

@AustinWise, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR.

Thanks, DNFBOT;

@dnfclas dnfclas added the cla-signed label Jul 8, 2015
else
{
return StringBuilderCache.GetStringAndRelease(sb);
}

This comment has been minimized.

@stephentoub

stephentoub Jul 8, 2015
Member

Why isn't this releasing the StringBuilder in the first case, too? Rather than rewrite the whole expression with multiple calls to GetStringAndRelease, rather than the current code that does:

return stuff;

I'd do:

string result = stuff;
StringBuilderCache.Release(sb);
return result;

This comment has been minimized.

@AustinWise

AustinWise Jul 8, 2015
Author Collaborator

Opps, missed another release. I'll revise it.

@stephentoub
Copy link
Member

@stephentoub stephentoub commented Jul 8, 2015

Thanks for the fix and the revision. LGTM.

@stephentoub
Copy link
Member

@stephentoub stephentoub commented Jul 8, 2015

@AustinWise, could you squash these? I didn't notice previously that this was done as two commits, and the second really obviates the first rather than builds on it.

@AustinWise
Copy link
Collaborator Author

@AustinWise AustinWise commented Jul 8, 2015

Yeah, I'll do that. I was just not sure if it would mess up the pull request somehow if I edited the commits.

@stephentoub
Copy link
Member

@stephentoub stephentoub commented Jul 8, 2015

Cool, thanks 😄

stephentoub added a commit that referenced this pull request Jul 8, 2015
Release the StringBuilder back to the StringBuilderCache.
@stephentoub stephentoub merged commit 0fa3956 into dotnet:master Jul 8, 2015
1 check passed
1 check passed
default Build finished. No test results found.
Details
@karelz karelz modified the milestone: 1.0.0-rtm Dec 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.