diff options
Diffstat (limited to 'Source/cmDocumentationFormatterHTML.cxx')
-rw-r--r-- | Source/cmDocumentationFormatterHTML.cxx | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/Source/cmDocumentationFormatterHTML.cxx b/Source/cmDocumentationFormatterHTML.cxx index 7422ef4..0c44ed7 100644 --- a/Source/cmDocumentationFormatterHTML.cxx +++ b/Source/cmDocumentationFormatterHTML.cxx @@ -32,24 +32,23 @@ static bool cmDocumentationIsHyperlinkChar(char c) static void cmDocumentationPrintHTMLChar(std::ostream& os, char c) { // Use an escape sequence if necessary. - static std::map<char,std::string> escapes; - if (escapes.empty()) + switch (c) { - escapes['<'] = "<"; - escapes['>'] = ">"; - escapes['&'] = "&"; - escapes['\n'] = "<br>"; - } - - if (escapes.find(c) == escapes.end()) - { - // No escape sequence is needed. - os << c; - return; - } - - os << escapes[c]; - return; + case '<': + os << "<"; + break; + case '>': + os << ">"; + break; + case '&': + os << "&"; + break; + case '\n': + os << "<br>"; + break; + default: + os << c; + } } //---------------------------------------------------------------------------- |