From e53b2dab6b58ea8515745c6bfac3111acf233616 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 29 Jun 2014 10:10:46 -0700 Subject: [PATCH] Eliminate a string copy for @ fonts in the fonts collector --- src/font_file_lister_fontconfig.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/font_file_lister_fontconfig.cpp b/src/font_file_lister_fontconfig.cpp index 94924ad1b..28051040a 100644 --- a/src/font_file_lister_fontconfig.cpp +++ b/src/font_file_lister_fontconfig.cpp @@ -84,9 +84,7 @@ FontConfigFontFileLister::FontConfigFontFileLister(FontCollectorStatusCallback c FontFileLister::CollectionResult FontConfigFontFileLister::GetFontPaths(std::string const& facename, int bold, bool italic, std::set const& characters) { CollectionResult ret; - std::string family(facename); - if (family[0] == '@') - family.erase(0, 1); + std::string family = facename[0] == '@' ? facename.substr(1) : facename; boost::to_lower(family); int weight = bold == 0 ? 80 :