Iterate over initializer_lists to avoid mem allocs

Authored by dhaumann on Feb 24 2018, 10:21 PM.

Description

Iterate over initializer_lists to avoid mem allocs

Summary:
I had to add a helper function to avoid messy
STL iterator code everywhere. Not an ideal solution,
but std::contains() simply still does not exist, yet :-)

Test Plan: make test

Reviewers: mwolff, apol

Reviewed By: apol

Subscribers: ngraham, Frameworks

Tags: Kate, Frameworks

Differential Revision: https://phabricator.kde.org/D9211