diff options
author | George Burgess IV <gbiv@google.com> | 2020-04-01 12:38:16 -0700 |
---|---|---|
committer | George Burgess <gbiv@chromium.org> | 2020-04-01 20:41:55 +0000 |
commit | afadccb836da9e84f0bc5cfcf5566ce8b1322272 (patch) | |
tree | 98c1ccad21ab3a4bdbf0ddcc1f2f1998db6091b7 /compiler_wrapper | |
parent | ca8e8b8dc0f702eaa3c74f9b5468547623423a41 (diff) | |
download | toolchain-utils-afadccb836da9e84f0bc5cfcf5566ce8b1322272.tar.gz |
compiler_wrapper: s/strings.Contains/bytes.Contains/
Rather than turning all of stderr into a string here, we can turn the
thing we're searching for into a []byte. Should shave off a few cycles,
and is just as readable.
BUG=None
TEST=unittests
Change-Id: Ib4cc916ada11e0d8e286775b15dd93998c8403aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/2132721
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Tested-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper')
-rw-r--r-- | compiler_wrapper/disable_werror_flag.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler_wrapper/disable_werror_flag.go b/compiler_wrapper/disable_werror_flag.go index 65ea1ab1..3decbf29 100644 --- a/compiler_wrapper/disable_werror_flag.go +++ b/compiler_wrapper/disable_werror_flag.go @@ -62,7 +62,7 @@ func doubleBuildWithWNoError(env env, cfg *config, newWarningsDir string, origin } // The only way we can do anything useful is if it looks like the failure // was -Werror-related. - if originalExitCode == 0 || !strings.Contains(originalStderrBuffer.String(), "-Werror") { + if originalExitCode == 0 || !bytes.Contains(originalStderrBuffer.Bytes(), []byte("-Werror")) { originalStdoutBuffer.WriteTo(env.stdout()) originalStderrBuffer.WriteTo(env.stderr()) return originalExitCode, nil |