mongo-csharp-driver
mongo-csharp-driver copied to clipboard
CSHARP-2442: Increase StringBuilder capacity
This StringBuilder object is being created because the string named "value" needs escaping. It is unknown at this point exactly how many characters need escaping, but AT MINIMUM there is one. This means the new escaped string length will be larger than original string length by at least one character, and the StringBuilder constructor capacity parameter should reflect this logic. Without this change, the StringBuilder object is GUARANTEED to allocate and chain together a new StringBuilder object under the hood as it increases it's capacity to handle the larger escaped string.
Hi @Achilles1515 as per our contributing guide, please open an issue at jira.mongodb.org in the CSHARP project and link it to the pull request.
Thanks, Jeff
Hi @Achilles1515 as per our contributing guide, please open an issue at jira.mongodb.org in the CSHARP project and link it to the pull request.
Thanks, Jeff
Done. Sorry about that.
This PR was included as part of PR https://github.com/mongodb/mongo-csharp-driver/pull/1290
Thank you for submitting it.