From cad7100fda1b27ba56c4d9efc6bceba62859dfbc Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 13 May 2018 21:53:07 -0700 Subject: QByteArray: add compare() with case sensitivity options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Need to do the same for startsWith() and endsWith(). indexOf() is a lot harder. [ChangeLog][QtCore][QByteArray] Added compare(), which takes Qt::CaseSensitivity as one of the parameters. This function is more efficient than using toLower() or toUpper() and then comparing. Change-Id: Ib48364abee9f464c96c6fffd152e69bde4194df7 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/eglfs/api/qeglfsintegration.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/plugins/platforms/eglfs') diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp index 33878a5f50..43f2e31a49 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp @@ -415,8 +415,7 @@ static void *eglContextForContext(QOpenGLContext *context) QPlatformNativeInterface::NativeResourceForContextFunction QEglFSIntegration::nativeResourceFunctionForContext(const QByteArray &resource) { #ifndef QT_NO_OPENGL - QByteArray lowerCaseResource = resource.toLower(); - if (lowerCaseResource == "get_egl_context") + if (resource.compare("get_egl_context", Qt::CaseInsensitive) == 0) return NativeResourceForContextFunction(eglContextForContext); #else Q_UNUSED(resource); -- cgit v1.2.3