PERF: reduce time for full docs as HTML from 1.4 s to 0.2 s, the map is now
created and filled only once instead for every character I guess a simple case-switch would be still faster. Alex
This commit is contained in:
parent
21f4cd7c8b
commit
e13db53a9a
|
@ -32,11 +32,14 @@ static bool cmDocumentationIsHyperlinkChar(char c)
|
||||||
static void cmDocumentationPrintHTMLChar(std::ostream& os, char c)
|
static void cmDocumentationPrintHTMLChar(std::ostream& os, char c)
|
||||||
{
|
{
|
||||||
// Use an escape sequence if necessary.
|
// Use an escape sequence if necessary.
|
||||||
std::map<char,std::string> escapes;
|
static std::map<char,std::string> escapes;
|
||||||
escapes['<'] = "<";
|
if (escapes.empty())
|
||||||
escapes['>'] = ">";
|
{
|
||||||
escapes['&'] = "&";
|
escapes['<'] = "<";
|
||||||
escapes['\n'] = "<br>";
|
escapes['>'] = ">";
|
||||||
|
escapes['&'] = "&";
|
||||||
|
escapes['\n'] = "<br>";
|
||||||
|
}
|
||||||
|
|
||||||
if (escapes.find(c) == escapes.end())
|
if (escapes.find(c) == escapes.end())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue