From 3f7ebc6bd9f388f69a2f9f0c05c332af0169aa94 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 5 Nov 2017 21:14:47 -0800 Subject: [PATCH] Avoid an unnecessary move of a string --- src/context.cpp | 2 +- src/sourcegroup.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/context.cpp b/src/context.cpp index fe44900..df64571 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -1334,7 +1334,7 @@ SourceGroup ContextImpl::createSourceGroup(StringView name) ); if(iter != mSourceGroups.end() && (*iter)->getName() == name) throw std::runtime_error("Duplicate source group name"); - iter = mSourceGroups.insert(iter, MakeUnique(this, String(name))); + iter = mSourceGroups.insert(iter, MakeUnique(this, name)); return SourceGroup(iter->get()); } diff --git a/src/sourcegroup.h b/src/sourcegroup.h index e94e867..086757c 100644 --- a/src/sourcegroup.h +++ b/src/sourcegroup.h @@ -44,8 +44,8 @@ class SourceGroupImpl : SourceGroupProps { void updateStoppedStatus() const; public: - SourceGroupImpl(ContextImpl *context, String name) - : mContext(context), mParent(nullptr), mName(std::move(name)) + SourceGroupImpl(ContextImpl *context, StringView name) + : mContext(context), mParent(nullptr), mName(String(name)) { } ALfloat getAppliedGain() const { return mGain * mParentProps.mGain; } -- 2.11.4.GIT