aboutsummaryrefslogtreecommitdiffstats
path: root/al/source.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-09-01 17:54:17 -0700
committerChris Robinson <[email protected]>2019-09-01 17:54:17 -0700
commitbb35e24c9ba7ec01c05fc1f07ef737c15821283a (patch)
tree446a56e69f7cce88a07ada7848298cdfbc9a775a /al/source.cpp
parent727217ce0a9765270551ad6e10a25ee0b7fb74e6 (diff)
Avoid unnecessary placement new definitions
Diffstat (limited to 'al/source.cpp')
-rw-r--r--al/source.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/al/source.cpp b/al/source.cpp
index 010dee1c..86a7d94c 100644
--- a/al/source.cpp
+++ b/al/source.cpp
@@ -491,13 +491,9 @@ ALsource *AllocSource(ALCcontext *context)
{ return entry.FreeMask != 0; }
);
auto lidx = static_cast<ALsizei>(std::distance(context->mSourceList.begin(), sublist));
- ALsource *source;
ALsizei slidx;
if LIKELY(sublist != context->mSourceList.end())
- {
slidx = CTZ64(sublist->FreeMask);
- source = sublist->Sources + slidx;
- }
else
{
/* Don't allocate so many list entries that the 32-bit ID could
@@ -521,10 +517,9 @@ ALsource *AllocSource(ALCcontext *context)
}
slidx = 0;
- source = sublist->Sources + slidx;
}
- source = new (source) ALsource{device->NumAuxSends};
+ ALsource *source{::new (sublist->Sources + slidx) ALsource{device->NumAuxSends}};
/* Add 1 to avoid source ID 0. */
source->id = ((lidx<<6) | slidx) + 1;