Skip to content

Commit 9f7aa16

Browse files
kazutakahiratavarun-r-mallya
authored andcommitted
[Support] Simplify control flow in percentDecode (NFC) (llvm#165134)
The "if" statement being removed in this patch is identical to the "else" clause.
1 parent a54d85d commit 9f7aa16

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

llvm/lib/Support/LSP/Protocol.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ static void percentEncode(StringRef Content, std::string &Out) {
9696
static std::string percentDecode(StringRef Content) {
9797
std::string Result;
9898
for (auto I = Content.begin(), E = Content.end(); I != E; ++I) {
99-
if (*I != '%') {
100-
Result += *I;
101-
continue;
102-
}
10399
if (*I == '%' && I + 2 < Content.end() && llvm::isHexDigit(*(I + 1)) &&
104100
llvm::isHexDigit(*(I + 2))) {
105101
Result.push_back(llvm::hexFromNibbles(*(I + 1), *(I + 2)));

0 commit comments

Comments
 (0)