Skip to content

Commit

Permalink
Minor code cleanup to use generic string conversion.
Browse files Browse the repository at this point in the history
Use base::SysUTF8ToNSString to convert std::string to NSString instead
of using -[NSString stringWithUTF8String:].

BUG=None

Review-Url: https://codereview.chromium.org/2117113002
Cr-Commit-Position: refs/heads/master@{#403692}
  • Loading branch information
sdefresne authored and Commit bot committed Jul 4, 2016
1 parent 4ca5df8 commit 7126f48
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ios/chrome/browser/ui/file_locations.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@
const std::string& language,
const std::string& ext) {
std::string resource_file(base_name + "_" + language);
BOOL exists =
[base::mac::FrameworkBundle()
URLForResource:[NSString stringWithUTF8String:resource_file.c_str()]
withExtension:[NSString stringWithUTF8String:ext.c_str()]] != nil;
return exists ? resource_file + "." + ext : "";
BOOL exists = [base::mac::FrameworkBundle()
URLForResource:base::SysUTF8ToNSString(resource_file)
withExtension:base::SysUTF8ToNSString(ext)] != nil;
return exists ? resource_file + "." + ext : std::string();
}

} // namespace
Expand Down

0 comments on commit 7126f48

Please sign in to comment.