Browse Source

GL: don't use the slower splitOnWhitespace() when split() is enough.

The code was splitting on just a whitespace before the changes in
95b3f8578d (2021), so I suppose I just
accidentally copied the same code over from handling the
--disable-extensions and --disable-workarounds arguments, where the user
*is* allowed to use any whitespaces.

And given that just a space worked well for over a decade before,
there's no reason to pessimistically expect the extension strings
suddenly include tabs or newlines.
next
Vladimír Vondruš 2 months ago
parent
commit
82c76d3374
  1. 2
      src/Magnum/GL/Context.cpp

2
src/Magnum/GL/Context.cpp

@ -1199,7 +1199,7 @@ Containers::Array<Containers::StringView> Context::extensionStrings() const {
#if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2)
{
/* OpenGL 2.1 / OpenGL ES 2.0 doesn't have glGetStringi() */
return Containers::StringView{reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)), Containers::StringViewFlag::Global}.splitOnWhitespaceWithoutEmptyParts();
return Containers::StringView{reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)), Containers::StringViewFlag::Global}.splitWithoutEmptyParts(' ');
}
#endif
}

Loading…
Cancel
Save