Skip to content

Commit 4548334

Browse files
committed
use std::move with names in parser
1 parent 69a463e commit 4548334

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/private/xml_parser.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ namespace adm {
159159
if(idMap_.contains(id)) {
160160
throw error::XmlParsingDuplicateId(formatId(id), getDocumentLine(node));
161161
}
162-
auto audioProgramme = AudioProgramme::create(name, id);
162+
auto audioProgramme = AudioProgramme::create(std::move(name), id);
163163

164164
setOptionalAttribute<AudioProgrammeLanguage>(node, "audioProgrammeLanguage", audioProgramme);
165165
setOptionalAttribute<Start>(node, "start", audioProgramme, &parseTimecode);
@@ -183,7 +183,7 @@ namespace adm {
183183
if(idMap_.contains(id)) {
184184
throw error::XmlParsingDuplicateId(formatId(id), getDocumentLine(node));
185185
}
186-
auto audioContent = AudioContent::create(name, id);
186+
auto audioContent = AudioContent::create(std::move(name), id);
187187

188188
setOptionalAttribute<AudioContentLanguage>(node, "audioContentLanguage", audioContent);
189189

@@ -204,7 +204,7 @@ namespace adm {
204204
if(idMap_.contains(id)) {
205205
throw error::XmlParsingDuplicateId(formatId(id), getDocumentLine(node));
206206
}
207-
auto audioObject = AudioObject::create(name, id);
207+
auto audioObject = AudioObject::create(std::move(name), id);
208208

209209
setOptionalAttribute<Start>(node, "start", audioObject, &parseTimecode);
210210
setOptionalAttribute<Duration>(node, "duration", audioObject, &parseTimecode);
@@ -314,14 +314,14 @@ namespace adm {
314314
checkChannelType(id, typeLabel, typeDefinition);
315315

316316
if(typeDescriptor == adm::TypeDefinition::HOA){
317-
auto audioPackFormat = AudioPackFormatHoa::create(name, id);
317+
auto audioPackFormat = AudioPackFormatHoa::create(std::move(name), id);
318318
setCommonProperties(audioPackFormat, node);
319319
setOptionalAttribute<Normalization>(node, "normalization", audioPackFormat);
320320
setOptionalAttribute<ScreenRef>(node, "screenRef", audioPackFormat);
321321
setOptionalAttribute<NfcRefDist>(node, "nfcRefDist", audioPackFormat);
322322
return audioPackFormat;
323323
} else {
324-
auto audioPackFormat = AudioPackFormat::create(name, typeDescriptor, id);
324+
auto audioPackFormat = AudioPackFormat::create(std::move(name), typeDescriptor, id);
325325
setCommonProperties(audioPackFormat, node);
326326
return audioPackFormat;
327327
}
@@ -346,7 +346,7 @@ namespace adm {
346346
if(idMap_.contains(id)) {
347347
throw error::XmlParsingDuplicateId(formatId(id), getDocumentLine(node));
348348
}
349-
auto audioChannelFormat = AudioChannelFormat::create(name, id.get<TypeDescriptor>(), id);
349+
auto audioChannelFormat = AudioChannelFormat::create(std::move(name), id.get<TypeDescriptor>(), id);
350350

351351
auto typeLabel = parseOptionalAttribute<TypeDescriptor>(node, "typeLabel", &parseTypeLabel);
352352
auto typeDefinition = parseOptionalAttribute<TypeDescriptor>(node, "typeDefinition", &parseTypeDefinition);
@@ -398,7 +398,7 @@ namespace adm {
398398
auto formatLabel = parseOptionalAttribute<FormatDescriptor>(node, "formatLabel", &parseFormatLabel);
399399
auto formatDefinition = parseOptionalAttribute<FormatDescriptor>(node, "formatDefinition", &parseFormatDefinition);
400400
auto format = checkFormat(formatLabel, formatDefinition);
401-
auto audioStreamFormat = AudioStreamFormat::create(name, format, id);
401+
auto audioStreamFormat = AudioStreamFormat::create(std::move(name), format, id);
402402

403403
setOptionalReference<AudioChannelFormatId>(node, "audioChannelFormatIDRef", audioStreamFormat, streamFormatChannelFormatRef_, &parseAudioChannelFormatId);
404404
setOptionalReference<AudioPackFormatId>(node, "audioPackFormatIDRef", audioStreamFormat, streamFormatPackFormatRef_, &parseAudioPackFormatId);
@@ -420,7 +420,7 @@ namespace adm {
420420
auto formatDefinition = parseOptionalAttribute<FormatDescriptor>(node, "formatDefinition", &parseFormatDefinition);
421421
auto format = checkFormat(formatLabel, formatDefinition);
422422

423-
auto audioTrackFormat = AudioTrackFormat::create(name, format, id);
423+
auto audioTrackFormat = AudioTrackFormat::create(std::move(name), format, id);
424424

425425
setOptionalReference<AudioStreamFormatId>(node, "audioStreamFormatIDRef", audioTrackFormat, trackFormatStreamFormatRef_, &parseAudioStreamFormatId);
426426
// clang-format on

0 commit comments

Comments
 (0)