mirror of
https://github.com/SFML/SFML.git
synced 2025-02-22 22:36:02 +08:00
Don't bother marking lambdas as static
The compiler already ensures that these are only constructed once so it's not meaningful to also add static here to potentially optimize.
This commit is contained in:
parent
58a3abd433
commit
f8aff1bc0a
@ -42,7 +42,7 @@ int main()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const auto vec2ToString = [](const sf::Vector2i vec2)
|
const auto vec2ToString = [](const sf::Vector2i vec2)
|
||||||
{ return '(' + std::to_string(vec2.x) + ", " + std::to_string(vec2.y) + ')'; };
|
{ return '(' + std::to_string(vec2.x) + ", " + std::to_string(vec2.y) + ')'; };
|
||||||
|
|
||||||
if (const auto* const mouseMoved = event->getIf<sf::Event::MouseMoved>())
|
if (const auto* const mouseMoved = event->getIf<sf::Event::MouseMoved>())
|
||||||
|
@ -55,7 +55,7 @@ namespace
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void extensionSanityCheck()
|
void extensionSanityCheck()
|
||||||
{
|
{
|
||||||
static const auto check = [](int& flag, auto... entryPoints)
|
const auto check = [](int& flag, auto... entryPoints)
|
||||||
{
|
{
|
||||||
// If a required entry point is missing, flag the whole extension as unavailable
|
// If a required entry point is missing, flag the whole extension as unavailable
|
||||||
if (!(entryPoints && ...))
|
if (!(entryPoints && ...))
|
||||||
|
@ -919,7 +919,7 @@ void GlContext::initialize(const ContextSettings& requestedSettings)
|
|||||||
// Desktop OpenGL: The beginning of the returned string is "major.minor"
|
// Desktop OpenGL: The beginning of the returned string is "major.minor"
|
||||||
|
|
||||||
// Helper to parse OpenGL version strings
|
// Helper to parse OpenGL version strings
|
||||||
static const auto parseVersionString =
|
const auto parseVersionString =
|
||||||
[](const char* versionString, const char* prefix, unsigned int& major, unsigned int& minor)
|
[](const char* versionString, const char* prefix, unsigned int& major, unsigned int& minor)
|
||||||
{
|
{
|
||||||
const std::size_t prefixLength = std::strlen(prefix);
|
const std::size_t prefixLength = std::strlen(prefix);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user