optimize CMakeBuildDirChooser::buildDirSettings()

Summary:
-if we have a match for a key, no other key can match
-match the start of a new line as QByteArray instead of QString, most lines will
 not match and all keys are plain ASCII, this saves a lot of needless
 conversions and memory allocations
-modify the original line instead of doing a copy, the original one will not
 be used again anyway.

Test Plan: Open and build a CMake-based project.

Reviewers: mwolff

Reviewed By: mwolff

Subscribers: mwolff, apol, kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D18857
1 job for master in 60 minutes (queued for 1 second)
latest
Status Job ID Name Coverage
  Build
failed #1450
linux kf5-qt5 qt5.10

01:00:00

 
Name Stage Failure
failed
linux kf5-qt5 qt5.10 Build The script exceeded the maximum execution time set for the job
QDEBUG : TestProjectModel::initTestCase() qt.qpa.gl: Requested format before FBConfig/Visual selection: QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DefaultSwapBehavior), swapInterval 1, colorSpace QSurfaceFormat::ColorSpace(DefaultColorSpace), profile  QSurfaceFormat::OpenGLContextProfile(NoProfile))
QDEBUG : TestProjectModel::initTestCase() qt.qpa.gl: Available GLX extensions: GLX_ARB_context_flush_control GLX_ARB_create_context GLX_ARB_create_context_profile GLX_ARB_fbconfig_float GLX_ARB_framebuffer_sRGB GLX_ARB_get_proc_address GLX_ARB_multisample GLX_EXT_create_context_es2_profile GLX_EXT_create_context_es_profile GLX_EXT_fbconfig_packed_float GLX_EXT_framebuffer_sRGB GLX_EXT_import_context GLX_EXT_texture_from_pixmap GLX_EXT_visual_info GLX_EXT_visual_rating GLX_MESA_copy_sub_buffer GLX_MESA_query_renderer GLX_OML_swap_method GLX_SGIS_multisample GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGIX_visual_select_group GLX_SGI_make_current_read
QDEBUG : TestProjectModel::initTestCase() qt.qpa.gl: Got format: QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 0, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 0, stencilBufferSize 0, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DefaultSwapBehavior), swapInterval 1, colorSpace QSurfaceFormat::ColorSpace(DefaultColorSpace), profile QSurfaceFormat::OpenGLContextProfile(NoProfile))
QDEBUG : TestProjectModel::initTestCase() qt.qpa.input.events: XI2 mouse enter 201,99, mode 0, detail 0, time 1500388108

Start 10: test_highlighting
kf5.kinit.klauncher: new app ":1.5"
Pulling docker image gitlab/gitlab-runner-helper:x86_64-8d829975 ...
ERROR: Job failed: execution took longer than 1h0m0s seconds