aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2020-04-01 12:38:16 -0700
committerGeorge Burgess <gbiv@chromium.org>2020-04-01 20:41:55 +0000
commitafadccb836da9e84f0bc5cfcf5566ce8b1322272 (patch)
tree98c1ccad21ab3a4bdbf0ddcc1f2f1998db6091b7 /compiler_wrapper
parentca8e8b8dc0f702eaa3c74f9b5468547623423a41 (diff)
downloadtoolchain-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.go2
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