Avoid int to string conversion in Twine or raw_ostream contexts.
Some output changes from uppercase hex to lowercase hex, no other functionality change intended.
llvm-svn: 321526
diff --git a/clang-tools-extra/clangd/JSONRPCDispatcher.cpp b/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
index c67221a..fec7cd7 100644
--- a/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
+++ b/clang-tools-extra/clangd/JSONRPCDispatcher.cpp
@@ -196,7 +196,7 @@
log(Context::empty(),
"Warning: Duplicate Content-Length header received. "
"The previous value for this message (" +
- std::to_string(ContentLength) + ") was ignored.\n");
+ llvm::Twine(ContentLength) + ") was ignored.\n");
}
llvm::getAsUnsignedInteger(LineRef.trim(), 0, ContentLength);
@@ -230,10 +230,9 @@
// If the stream is aborted before we read ContentLength bytes, In
// will have eofbit and failbit set.
if (!In) {
- log(Context::empty(), "Input was aborted. Read only " +
- std::to_string(In.gcount()) +
- " bytes of expected " +
- std::to_string(ContentLength) + ".\n");
+ log(Context::empty(),
+ "Input was aborted. Read only " + llvm::Twine(In.gcount()) +
+ " bytes of expected " + llvm::Twine(ContentLength) + ".\n");
break;
}