mirror of
https://github.com/google/googletest.git
synced 2024-12-27 02:01:25 +08:00
Merge pull request #1225 from brian-peloton/master
Speed up printing of characters which need hex escaping
This commit is contained in:
commit
a868e618c0
@ -180,7 +180,10 @@ static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {
|
||||
*os << static_cast<char>(c);
|
||||
return kAsIs;
|
||||
} else {
|
||||
*os << "\\x" + String::FormatHexInt(static_cast<UnsignedChar>(c));
|
||||
ostream::fmtflags flags = os->flags();
|
||||
*os << "\\x" << std::hex << std::uppercase
|
||||
<< static_cast<int>(static_cast<UnsignedChar>(c));
|
||||
os->flags(flags);
|
||||
return kHexEscape;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user