summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2017-12-28 16:58:54 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2017-12-28 16:58:54 +0000
commit74e0320e6f7e63cc4dd8de46658eccee52ae75f5 (patch)
treedad5bac95819e7a19fe1a66ec49f059d00155b7c
parenta9e8b8880bbc3a63745f879f830c30383f0b0fa6 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321526 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--clangd/JSONRPCDispatcher.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clangd/JSONRPCDispatcher.cpp b/clangd/JSONRPCDispatcher.cpp
index c67221a2..fec7cd7e 100644
--- a/clangd/JSONRPCDispatcher.cpp
+++ b/clangd/JSONRPCDispatcher.cpp
@@ -196,7 +196,7 @@ void clangd::runLanguageServerLoop(std::istream &In, JSONOutput &Out,
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 @@ void clangd::runLanguageServerLoop(std::istream &In, JSONOutput &Out,
// 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;
}