mongo-csharp-driver icon indicating copy to clipboard operation
mongo-csharp-driver copied to clipboard

CSHARP-2442: Increase StringBuilder capacity

Open Achilles1515 opened this issue 6 years ago • 2 comments

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.

Achilles1515 avatar Nov 27 '18 17:11 Achilles1515

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

jyemin avatar Nov 27 '18 17:11 jyemin

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.

Achilles1515 avatar Nov 27 '18 18:11 Achilles1515

This PR was included as part of PR https://github.com/mongodb/mongo-csharp-driver/pull/1290

Thank you for submitting it.

rstam avatar Mar 13 '24 17:03 rstam