From 74e0320e6f7e63cc4dd8de46658eccee52ae75f5 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 28 Dec 2017 16:58:54 +0000 Subject: 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 --- clangd/JSONRPCDispatcher.cpp | 9 ++++----- 1 file 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; } -- cgit v1.2.3