summaryrefslogtreecommitdiffstats
path: root/chrome/browser/translate
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-16 19:32:17 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-16 19:32:17 +0000
commit7b63991292b12f0b86476fc18e41e6b91aee9e0e (patch)
treed2ebc7e579d3ebb83f623a00039de17d689108aa /chrome/browser/translate
parent11ed8aa271a03ee90d60f1913a09d3a55f56dcf4 (diff)
downloadchromium_src-7b63991292b12f0b86476fc18e41e6b91aee9e0e.zip
chromium_src-7b63991292b12f0b86476fc18e41e6b91aee9e0e.tar.gz
chromium_src-7b63991292b12f0b86476fc18e41e6b91aee9e0e.tar.bz2
Coverity: fix wrong assignment in swap in TranslateInfoBarDelegate2::GetAfterTranslateStrings.
CID=10888 BUG=none TEST=builds Review URL: http://codereview.chromium.org/2850007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/translate')
-rw-r--r--chrome/browser/translate/translate_infobar_delegate2.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/translate/translate_infobar_delegate2.cc b/chrome/browser/translate/translate_infobar_delegate2.cc
index 5598178..bc11024 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"
@@ -287,9 +289,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;