Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6196)

Unified Diff: chrome/browser/translate/translate_infobar_delegate2.cc

Issue 2850007: Coverity: fix wrong assignment in swap in TranslateInfoBarDelegate2::GetAfterTranslateStrings. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/translate/translate_infobar_delegate2.cc
diff --git a/chrome/browser/translate/translate_infobar_delegate2.cc b/chrome/browser/translate/translate_infobar_delegate2.cc
index 9b5395bf1b5c40450fde4ab73f63a8285044a9ce..5db8e1a72c1701c689642b2983aac5a6d31b18df 100644
--- a/chrome/browser/translate/translate_infobar_delegate2.cc
+++ b/chrome/browser/translate/translate_infobar_delegate2.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <algorithm>
+
#include "chrome/browser/translate/translate_infobar_delegate2.h"
#include "app/l10n_util.h"
@@ -283,9 +285,7 @@ void TranslateInfoBarDelegate2::GetAfterTranslateStrings(
if (offsets[0] > offsets[1]) {
// Target language comes before source.
- int tmp = offsets[0];
- offsets[0] = offsets[0];
- offsets[1] = tmp;
+ std::swap(offsets[0], offsets[1]);
*swap_languages = true;
} else {
*swap_languages = false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698