diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-11 23:16:24 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-11 23:16:24 +0000 |
commit | 1e1229a168974388ff8cda5e0e066b5978ec227f (patch) | |
tree | c9ea94374590415da82c09625fcf7dbdbf5826a6 /tools/gn/err.cc | |
parent | 216f48465ec76e97c83f375bc3e0bed1c0344caa (diff) | |
download | chromium_src-1e1229a168974388ff8cda5e0e066b5978ec227f.zip chromium_src-1e1229a168974388ff8cda5e0e066b5978ec227f.tar.gz chromium_src-1e1229a168974388ff8cda5e0e066b5978ec227f.tar.bz2 |
Remove ContainsOnlyWhitespace from string_util and CollapseWhitespace into to the base namespace
This function is only used in a few places and can trivially be implemented by passing the whitespace constant to the existing ContainsOnlyChars function.
This changes the ContainsOnlyChars function signature to take a StringPiece to avoid a copy from a literal to a standard string in the above-mentioned use-base.
Re-implement ContainsOnlyChars to use the find_first_not_of function on StringPiece.
BUG=
R=viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/183683024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/gn/err.cc')
-rw-r--r-- | tools/gn/err.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/gn/err.cc b/tools/gn/err.cc index 1ba1a62..8038bad 100644 --- a/tools/gn/err.cc +++ b/tools/gn/err.cc @@ -175,7 +175,7 @@ void Err::InternalPrintToStdout(bool is_sub_err) const { if (input_file) { std::string line = GetNthLine(input_file->contents(), location_.line_number()); - if (!ContainsOnlyWhitespaceASCII(line)) { + if (!base::ContainsOnlyChars(line, base::kWhitespaceASCII)) { OutputString(line + "\n", DECORATION_DIM); OutputHighlighedPosition(location_, ranges_, line.size()); } |