File tree Expand file tree Collapse file tree 2 files changed +4
-21
lines changed Expand file tree Collapse file tree 2 files changed +4
-21
lines changed Original file line number Diff line number Diff line change @@ -114,10 +114,8 @@ struct FuncBranchData {
114114
115115 FuncBranchData () {}
116116
117- FuncBranchData (StringRef Name, ContainerTy Data)
118- : Name(Name), Data(std::move(Data)) {}
119-
120- FuncBranchData (StringRef Name, ContainerTy Data, ContainerTy EntryData)
117+ FuncBranchData (StringRef Name, ContainerTy Data = ContainerTy(),
118+ ContainerTy EntryData = ContainerTy())
121119 : Name(Name), Data(std::move(Data)), EntryData(std::move(EntryData)) {}
122120
123121 ErrorOr<const BranchInfo &> getBranch (uint64_t From, uint64_t To) const ;
Original file line number Diff line number Diff line change @@ -1136,26 +1136,11 @@ std::error_code DataReader::parseInNoLBRMode() {
11361136
11371137std::error_code DataReader::parse () {
11381138 auto GetOrCreateFuncEntry = [&](StringRef Name) {
1139- auto I = NamesToBranches.find (Name);
1140- if (I == NamesToBranches.end ()) {
1141- bool Success;
1142- std::tie (I, Success) = NamesToBranches.insert (std::make_pair (
1143- Name, FuncBranchData (Name, FuncBranchData::ContainerTy (),
1144- FuncBranchData::ContainerTy ())));
1145- assert (Success && " unexpected result of insert" );
1146- }
1147- return I;
1139+ return NamesToBranches.try_emplace (Name, Name).first ;
11481140 };
11491141
11501142 auto GetOrCreateFuncMemEntry = [&](StringRef Name) {
1151- auto I = NamesToMemEvents.find (Name);
1152- if (I == NamesToMemEvents.end ()) {
1153- bool Success;
1154- std::tie (I, Success) = NamesToMemEvents.insert (
1155- std::make_pair (Name, FuncMemData (Name, FuncMemData::ContainerTy ())));
1156- assert (Success && " unexpected result of insert" );
1157- }
1158- return I;
1143+ return NamesToMemEvents.try_emplace (Name, Name).first ;
11591144 };
11601145
11611146 Col = 0 ;
You can’t perform that action at this time.
0 commit comments