mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
minor cleanup of some audio decoder code.
This commit is contained in:
@@ -52,12 +52,12 @@ bool FLACDecoder::accepts(const std::string &ext)
|
|||||||
// Please remove once it's no longer the case.
|
// Please remove once it's no longer the case.
|
||||||
static const std::string supported[] =
|
static const std::string supported[] =
|
||||||
{
|
{
|
||||||
"flac", "ogg", ""
|
"flac", "ogg"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; !(supported[i].empty()); i++)
|
for (const auto& s : supported)
|
||||||
{
|
{
|
||||||
if (supported[i].compare(ext) == 0)
|
if (s.compare(ext) == 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,12 +72,12 @@ bool GmeDecoder::accepts(const std::string &ext)
|
|||||||
static const std::string supported[] =
|
static const std::string supported[] =
|
||||||
{
|
{
|
||||||
"ay", "gbs", "gym", "hes", "kss", "nsf",
|
"ay", "gbs", "gym", "hes", "kss", "nsf",
|
||||||
"nsfe", "sap", "spc", "vgm", "vgz", ""
|
"nsfe", "sap", "spc", "vgm", "vgz",
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; !(supported[i].empty()); i++)
|
for (const auto& s : supported)
|
||||||
{
|
{
|
||||||
if (supported[i].compare(ext) == 0)
|
if (s.compare(ext) == 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,12 +74,12 @@ bool MP3Decoder::accepts(const std::string &ext)
|
|||||||
{
|
{
|
||||||
static const std::string supported[] =
|
static const std::string supported[] =
|
||||||
{
|
{
|
||||||
"mp3", ""
|
"mp3"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; !(supported[i].empty()); i++)
|
for (const auto& s : supported)
|
||||||
{
|
{
|
||||||
if (supported[i].compare(ext) == 0)
|
if (s.compare(ext) == 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,12 +84,11 @@ bool ModPlugDecoder::accepts(const std::string &ext)
|
|||||||
"dsm", "far", "it", "j2b", "mdl", "med",
|
"dsm", "far", "it", "j2b", "mdl", "med",
|
||||||
"mid", "mod", "mt2", "mtm", "okt", "pat",
|
"mid", "mod", "mt2", "mtm", "okt", "pat",
|
||||||
"psm", "s3m", "stm", "ult", "umx", "xm",
|
"psm", "s3m", "stm", "ult", "umx", "xm",
|
||||||
""
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; !(supported[i].empty()); i++)
|
for (const auto &s : supported)
|
||||||
{
|
{
|
||||||
if (supported[i].compare(ext) == 0)
|
if (s.compare(ext) == 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,12 +168,12 @@ bool VorbisDecoder::accepts(const std::string &ext)
|
|||||||
{
|
{
|
||||||
static const std::string supported[] =
|
static const std::string supported[] =
|
||||||
{
|
{
|
||||||
"ogg", "oga", "ogv", ""
|
"ogg", "oga", "ogv"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; !(supported[i].empty()); i++)
|
for (const auto& s : supported)
|
||||||
{
|
{
|
||||||
if (supported[i].compare(ext) == 0)
|
if (s.compare(ext) == 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,12 +103,12 @@ bool WaveDecoder::accepts(const std::string &ext)
|
|||||||
{
|
{
|
||||||
static const std::string supported[] =
|
static const std::string supported[] =
|
||||||
{
|
{
|
||||||
"wav", ""
|
"wav"
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; !(supported[i].empty()); i++)
|
for (const auto& s : supported)
|
||||||
{
|
{
|
||||||
if (supported[i].compare(ext) == 0)
|
if (s.compare(ext) == 0)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user