<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:56:34 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-1270] BSON library uses strlen to get the length of std::string objects</title>
                <link>https://jira.mongodb.org/browse/SERVER-1270</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;std::string objects have known lengths. In the current implementation of the BSON library, std::string objects used as keys or values are converted to const char*&apos;s with std::string::c_str(), and then passed to the const char* overload:&lt;/p&gt;

&lt;p&gt;/** add a subobject as a member */&lt;br/&gt;
BSONObjBuilder&amp;amp; append(const string&amp;amp; fieldName , BSONObj subObj) {&lt;br/&gt;
    return append( fieldName.c_str() , subObj );&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;That eventually makes its way to BufBuilder::append, where it calls strlen, unnecessarily recomputing the length:&lt;/p&gt;

&lt;p&gt;void append(const char *str) {&lt;br/&gt;
   append((void*) str, strlen(str)+1);&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;Given that std::string objects have known lengths, the call to strlen is a complete waste of time.&lt;/p&gt;</description>
                <environment>All</environment>
        <key id="12210">SERVER-1270</key>
            <summary>BSON library uses strlen to get the length of std::string objects</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="alerner">Alberto Lerner</assignee>
                                    <reporter username="andrew.morrow@mongodb.com">Andrew Morrow</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Jun 2010 12:37:35 +0000</created>
                <updated>Tue, 12 Jul 2016 00:30:26 +0000</updated>
                            <resolved>Tue, 20 Jul 2010 17:05:59 +0000</resolved>
                                    <version>1.5.3</version>
                                    <fixVersion>1.5.6</fixVersion>
                                    <component>Internal Client</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="15984" author="auto" created="Tue, 20 Jul 2010 17:01:09 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Elim remaining c_str()&apos;s&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/4ab45012de3f54ca09e4bf6738295d8f9279eef8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/4ab45012de3f54ca09e4bf6738295d8f9279eef8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15983" author="auto" created="Tue, 20 Jul 2010 17:00:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Elim c_str() /util&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/5a576ddbe0c79eda812d40b8b80c1344bacb3096&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/5a576ddbe0c79eda812d40b8b80c1344bacb3096&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15982" author="auto" created="Tue, 20 Jul 2010 16:59:45 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Elim c_str() /tools&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/37c9c403de1013c47d3aab5a75abc4b3323d66d9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/37c9c403de1013c47d3aab5a75abc4b3323d66d9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15981" author="auto" created="Tue, 20 Jul 2010 16:59:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Elim c_str() /s&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/4b2de232c9cf5bf0f227d97fe03c39d17a2e849b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/4b2de232c9cf5bf0f227d97fe03c39d17a2e849b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15980" author="auto" created="Tue, 20 Jul 2010 16:58:36 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Elim c_str() /client&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/ed0081deed460e5733681af5b12c7729dc464412&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/ed0081deed460e5733681af5b12c7729dc464412&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15979" author="auto" created="Tue, 20 Jul 2010 16:43:32 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Elim c_str() /scripting&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/5227b6777f27acfac30006e4193033e2b33735bd&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/5227b6777f27acfac30006e4193033e2b33735bd&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15978" author="auto" created="Tue, 20 Jul 2010 16:40:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Elim c_str() /db&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/2b14da5f103a3d4e1a95c8d8bfa10a8470839bc1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/2b14da5f103a3d4e1a95c8d8bfa10a8470839bc1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15977" author="auto" created="Tue, 20 Jul 2010 16:30:54 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Missed one call in BSONObjBuilder&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/67710484c107d2aac4533e87f1376f5e4638f713&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/67710484c107d2aac4533e87f1376f5e4638f713&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15976" author="auto" created="Tue, 20 Jul 2010 16:08:41 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Elim c_str() /db&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/67097550ed52d2536eb9902eda2a15e7b7366841&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/67097550ed52d2536eb9902eda2a15e7b7366841&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15972" author="auto" created="Tue, 20 Jul 2010 15:16:35 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Hook StringData to BSONObjBuilder&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/27dde175e09492bb6230eadbb0e099d3c3a240e8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/27dde175e09492bb6230eadbb0e099d3c3a240e8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15901" author="auto" created="Mon, 19 Jul 2010 10:31:20 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Fix example code&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/62c0c861b2a00633d9e5952b1ecb35c75c3c2bf1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/62c0c861b2a00633d9e5952b1ecb35c75c3c2bf1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15900" author="auto" created="Mon, 19 Jul 2010 09:57:53 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Hook StringData to BufBuilder&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/f51a4d0669bf413d34e93c9a1c792f94edfdd757&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/f51a4d0669bf413d34e93c9a1c792f94edfdd757&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15892" author="auto" created="Sat, 17 Jul 2010 16:09:11 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: Revert &quot;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Prep for hooking StringData&quot;&lt;/p&gt;

&lt;p&gt;This reverts commit b7c9a9fc576758ef6e7095ec0fbd2def0deb9b5b.&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/daf8c0fbd09f5730adb7511b882c1a5ba671eb08&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/daf8c0fbd09f5730adb7511b882c1a5ba671eb08&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15891" author="auto" created="Sat, 17 Jul 2010 14:34:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Prep for hooking StringData&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/b7c9a9fc576758ef6e7095ec0fbd2def0deb9b5b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/b7c9a9fc576758ef6e7095ec0fbd2def0deb9b5b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15810" author="auto" created="Wed, 14 Jul 2010 18:16:39 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; StringData unit test&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/16e0a0b65664b63991b0b8d01ecf9bebe449c39b&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/16e0a0b65664b63991b0b8d01ecf9bebe449c39b&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15538" author="auto" created="Wed, 7 Jul 2010 17:54:26 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Go all the way const&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/7755d602c439050b519daf3a8012ab1411ccd9e5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/7755d602c439050b519daf3a8012ab1411ccd9e5&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15523" author="auto" created="Wed, 7 Jul 2010 14:54:19 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Length uniform in all ctors (thanks Mathias)&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/13a235bcf39a2610f0314a701ceb75dd6db2aeb8&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/13a235bcf39a2610f0314a701ceb75dd6db2aeb8&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15522" author="auto" created="Wed, 7 Jul 2010 13:56:24 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Improve StringData (on behalf of Andrew Morrow)&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/4bccb4792c8649b965fde46bb2c41a825526729f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/4bccb4792c8649b965fde46bb2c41a825526729f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15496" author="acm" created="Wed, 7 Jul 2010 10:35:50 +0000"  >&lt;p&gt;Hi Alberto -&lt;/p&gt;

&lt;p&gt;I like the string class. A couple comments:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Maybe make StringData immutable by making the data pointer and size const. That requires that the members be set up in initializer lists.&lt;/li&gt;
	&lt;li&gt;Add a templated ctor and an overload resolution tag so that you can construct a StringData from a compile time string literal without a call to strlen.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;You end up with:&lt;/p&gt;

&lt;p&gt;struct StringData {&lt;/p&gt;

&lt;p&gt;    const char* const data;&lt;br/&gt;
    const unsigned    size;&lt;/p&gt;

&lt;p&gt;    StringData( const char * c )&lt;br/&gt;
        : data(c)&lt;br/&gt;
        , size(strlen(c)) {}&lt;/p&gt;

&lt;p&gt;    StringData( const std::string&amp;amp; s )&lt;br/&gt;
        : data(s.c_str())&lt;br/&gt;
        , size(s.size()) {}&lt;/p&gt;

&lt;p&gt;    struct literal_tag {};&lt;br/&gt;
    template&amp;lt;size_t N&amp;gt;&lt;br/&gt;
    StringData( const char (&amp;amp;val)&lt;span class=&quot;error&quot;&gt;&amp;#91;N&amp;#93;&lt;/span&gt;, literal_tag )&lt;br/&gt;
        : data(&amp;amp;val&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;)&lt;br/&gt;
        , size(N) {}&lt;br/&gt;
};&lt;/p&gt;</comment>
                            <comment id="15476" author="auto" created="Wed, 7 Jul 2010 00:54:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; A string class that can take both a strig and a char *. We&apos;ll apply next&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/e7cb7ecb5c8d17c622ca1f701a3ba31d04ff5c1a&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/e7cb7ecb5c8d17c622ca1f701a3ba31d04ff5c1a&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="15472" author="eliot" created="Tue, 6 Jul 2010 22:00:49 +0000"  >&lt;p&gt;I think there are a lot more places we do this same thing in bsonobjbuilder.&lt;/p&gt;

&lt;p&gt;We should probably add a helper&lt;/p&gt;

&lt;p&gt;_appendElementStart( type , const string&amp;amp; name ){&lt;br/&gt;
   ...&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;almost everywhere we call .c_str() in bsonobjbuilder.h is inneficient&lt;/p&gt;</comment>
                            <comment id="15469" author="auto" created="Tue, 6 Jul 2010 20:34:59 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;login&apos;: &apos;alerner&apos;, &apos;name&apos;: &apos;Alberto Lerner&apos;, &apos;email&apos;: &apos;alerner@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-1270&quot; title=&quot;BSON library uses strlen to get the length of std::string objects&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-1270&quot;&gt;&lt;del&gt;SERVER-1270&lt;/del&gt;&lt;/a&gt; Make it a bit faster for std::string&apos;s&lt;br/&gt;
&lt;a href=&quot;http://github.com/mongodb/mongo/commit/cc37c07bb561c5ad30e7b1a4fb68e88822dd13ec&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/mongodb/mongo/commit/cc37c07bb561c5ad30e7b1a4fb68e88822dd13ec&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>22.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 6 Jul 2010 20:34:59 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        13 years, 31 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            13 years, 31 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>alerner</customfieldvalue>
            <customfieldvalue>andrew.morrow@mongodb.com</customfieldvalue>
            <customfieldvalue>auto</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpl1b:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrikjj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>21980</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrnvin:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>