Add const & to foreach to save copies of "complex" types Remove initializations of QStrings to "" since they do nothing Return QString instead of "" since its faster Pass "complex" types as const & instead of copy to functions Not an optimization: Added const qualifier to two functions .