Skip to content

Commit 83502ce

Browse files
committed
[C++] Move constructor arguments.
To guarantee that copies are avoided.
1 parent 76af709 commit 83502ce

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

sbe-tool/src/main/cpp/otf/Encoding.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,14 +343,14 @@ class Encoding
343343
m_presence(presence),
344344
m_primitiveType(type),
345345
m_byteOrder(byteOrder),
346-
m_minValue(minValue),
347-
m_maxValue(maxValue),
348-
m_nullValue(nullValue),
349-
m_constValue(constValue),
350-
m_characterEncoding(characterEncoding),
351-
m_epoch(epoch),
352-
m_timeUnit(timeUnit),
353-
m_semanticType(semanticType)
346+
m_minValue(std::move(minValue)),
347+
m_maxValue(std::move(maxValue)),
348+
m_nullValue(std::move(nullValue)),
349+
m_constValue(std::move(constValue)),
350+
m_characterEncoding(std::move(characterEncoding)),
351+
m_epoch(std::move(epoch)),
352+
m_timeUnit(std::move(timeUnit)),
353+
m_semanticType(std::move(semanticType))
354354
{
355355
}
356356

sbe-tool/src/main/cpp/otf/Token.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ class Token
8686
m_encodedLength(encodedLength),
8787
m_componentTokenCount(componentTokenCount),
8888
m_signal(signal),
89-
m_name(name),
90-
m_description(description),
91-
m_encoding(encoding)
89+
m_name(std::move(name)),
90+
m_description(std::move(description)),
91+
m_encoding(std::move(encoding))
9292
{
9393
}
9494

0 commit comments

Comments
 (0)