summaryrefslogtreecommitdiffstats
path: root/Source/cmDocumentationFormatterHTML.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmDocumentationFormatterHTML.cxx')
-rw-r--r--Source/cmDocumentationFormatterHTML.cxx33
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['<'] = "&lt;";
- escapes['>'] = "&gt;";
- escapes['&'] = "&amp;";
- escapes['\n'] = "<br>";
- }
-
- if (escapes.find(c) == escapes.end())
- {
- // No escape sequence is needed.
- os << c;
- return;
- }
-
- os << escapes[c];
- return;
+ case '<':
+ os << "&lt;";
+ break;
+ case '>':
+ os << "&gt;";
+ break;
+ case '&':
+ os << "&amp;";
+ break;
+ case '\n':
+ os << "<br>";
+ break;
+ default:
+ os << c;
+ }
}
//----------------------------------------------------------------------------