aboutsummaryrefslogtreecommitdiffstats
path: root/al/effects
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-01-13 01:25:20 -0800
committerChris Robinson <[email protected]>2023-01-13 01:25:20 -0800
commit974d1b9e6d174f1680604b2872911110f6a0e41c (patch)
tree8dd9517957717b82977e433276a14b9892b3d563 /al/effects
parent97f2c28ddd79474e163f62d666fc8ce555f31e0f (diff)
Avoid unnecessary uses of make_optional
Diffstat (limited to 'al/effects')
-rw-r--r--al/effects/chorus.cpp4
-rw-r--r--al/effects/fshifter.cpp6
-rw-r--r--al/effects/modulator.cpp6
-rw-r--r--al/effects/vmorpher.cpp8
4 files changed, 12 insertions, 12 deletions
diff --git a/al/effects/chorus.cpp b/al/effects/chorus.cpp
index 1651ebb9..a05ec10b 100644
--- a/al/effects/chorus.cpp
+++ b/al/effects/chorus.cpp
@@ -31,8 +31,8 @@ inline al::optional<ChorusWaveform> WaveformFromEnum(ALenum type)
{
switch(type)
{
- case AL_CHORUS_WAVEFORM_SINUSOID: return al::make_optional(ChorusWaveform::Sinusoid);
- case AL_CHORUS_WAVEFORM_TRIANGLE: return al::make_optional(ChorusWaveform::Triangle);
+ case AL_CHORUS_WAVEFORM_SINUSOID: return ChorusWaveform::Sinusoid;
+ case AL_CHORUS_WAVEFORM_TRIANGLE: return ChorusWaveform::Triangle;
}
return al::nullopt;
}
diff --git a/al/effects/fshifter.cpp b/al/effects/fshifter.cpp
index 400c0bf4..9ca28775 100644
--- a/al/effects/fshifter.cpp
+++ b/al/effects/fshifter.cpp
@@ -24,9 +24,9 @@ al::optional<FShifterDirection> DirectionFromEmum(ALenum value)
{
switch(value)
{
- case AL_FREQUENCY_SHIFTER_DIRECTION_DOWN: return al::make_optional(FShifterDirection::Down);
- case AL_FREQUENCY_SHIFTER_DIRECTION_UP: return al::make_optional(FShifterDirection::Up);
- case AL_FREQUENCY_SHIFTER_DIRECTION_OFF: return al::make_optional(FShifterDirection::Off);
+ case AL_FREQUENCY_SHIFTER_DIRECTION_DOWN: return FShifterDirection::Down;
+ case AL_FREQUENCY_SHIFTER_DIRECTION_UP: return FShifterDirection::Up;
+ case AL_FREQUENCY_SHIFTER_DIRECTION_OFF: return FShifterDirection::Off;
}
return al::nullopt;
}
diff --git a/al/effects/modulator.cpp b/al/effects/modulator.cpp
index e917e3a0..070b0998 100644
--- a/al/effects/modulator.cpp
+++ b/al/effects/modulator.cpp
@@ -24,9 +24,9 @@ al::optional<ModulatorWaveform> WaveformFromEmum(ALenum value)
{
switch(value)
{
- case AL_RING_MODULATOR_SINUSOID: return al::make_optional(ModulatorWaveform::Sinusoid);
- case AL_RING_MODULATOR_SAWTOOTH: return al::make_optional(ModulatorWaveform::Sawtooth);
- case AL_RING_MODULATOR_SQUARE: return al::make_optional(ModulatorWaveform::Square);
+ case AL_RING_MODULATOR_SINUSOID: return ModulatorWaveform::Sinusoid;
+ case AL_RING_MODULATOR_SAWTOOTH: return ModulatorWaveform::Sawtooth;
+ case AL_RING_MODULATOR_SQUARE: return ModulatorWaveform::Square;
}
return al::nullopt;
}
diff --git a/al/effects/vmorpher.cpp b/al/effects/vmorpher.cpp
index e1b7a698..e26c6fe3 100644
--- a/al/effects/vmorpher.cpp
+++ b/al/effects/vmorpher.cpp
@@ -23,7 +23,7 @@ namespace {
al::optional<VMorpherPhenome> PhenomeFromEnum(ALenum val)
{
#define HANDLE_PHENOME(x) case AL_VOCAL_MORPHER_PHONEME_ ## x: \
- return al::make_optional(VMorpherPhenome::x)
+ return VMorpherPhenome::x
switch(val)
{
HANDLE_PHENOME(A);
@@ -104,9 +104,9 @@ al::optional<VMorpherWaveform> WaveformFromEmum(ALenum value)
{
switch(value)
{
- case AL_VOCAL_MORPHER_WAVEFORM_SINUSOID: return al::make_optional(VMorpherWaveform::Sinusoid);
- case AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE: return al::make_optional(VMorpherWaveform::Triangle);
- case AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH: return al::make_optional(VMorpherWaveform::Sawtooth);
+ case AL_VOCAL_MORPHER_WAVEFORM_SINUSOID: return VMorpherWaveform::Sinusoid;
+ case AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE: return VMorpherWaveform::Triangle;
+ case AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH: return VMorpherWaveform::Sawtooth;
}
return al::nullopt;
}