[SERVER-29488] IDL-generated parse method uses string literals for field names instead of the generated constants Created: 07/Jun/17  Updated: 12/Jul/17  Resolved: 09/Jun/17

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Kaloian Manassiev Assignee: Spencer Jackson
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-29404 Performance pass of IDL generated code Closed
Operating System: ALL
Participants:

 Description   

The IDL-generated parser code already has StringData constants for the field names, but the parse method uses string literals directly. Seems like it should be using these constants instead.

For example:

constexpr StringData WriteOpTxnInfo::kStmtIdsFieldName;
constexpr StringData WriteOpTxnInfo::kTxnNumFieldName;
...
        if (fieldName == "txnNum") {
            if (ctxt.checkAndAssertType(element, NumberLong)) {
                _txnNum = element._numberLong();
            }
        }
        else if (fieldName == "stmtIds") {
            std::uint32_t expectedFieldNumber{0};
...



 Comments   
Comment by Spencer Jackson [ 09/Jun/17 ]

I believe the work for this is already in CR.

Generated at Thu Feb 08 04:21:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.