Skip to content

Commit

Permalink
Remove duplicate IsStringASCII call.
Browse files Browse the repository at this point in the history
Most methods need the check because they then call ConvertUnicode
but this particular method calls another UTF16ToUTF8 method which
will also perform the check and appropriate conversion.

BUG=

Review-Url: https://codereview.chromium.org/2560653002
Cr-Commit-Position: refs/heads/master@{#436809}
  • Loading branch information
bcwhite authored and Commit bot committed Dec 7, 2016
1 parent 28ca56a commit 9acdeae
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions base/strings/utf_string_conversions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ bool UTF16ToUTF8(const char16* src, size_t src_len, std::string* output) {
}

std::string UTF16ToUTF8(StringPiece16 utf16) {
if (IsStringASCII(utf16)) {
return std::string(utf16.begin(), utf16.end());
}

std::string ret;
// Ignore the success flag of this call, it will do the best it can for
// invalid input, which is what we want here.
Expand Down

0 comments on commit 9acdeae

Please sign in to comment.