Skip to content

Commit

Permalink
Avoid coercing integers to doubles when swapping for bubble sort.
Browse files Browse the repository at this point in the history
score_ is partially initialized, and while ultimately the uninit
elements are not used, coercing them to floating point generates uninit
reports when run under drmemory.  It's also unecessary, so I'm removing
it.

BUG=115326
R=jshin@chromium.org,timurrrr@chromium.org
TEST=comact_lang_det_unittest_small.cc under drmemory


Review URL: http://codereview.chromium.org/9465026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129050 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
rnk@chromium.org committed Mar 26, 2012
1 parent 8ab01cb commit 206ca33
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 2 additions & 2 deletions third_party/cld/encodings/compact_lang_det/tote.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand Down Expand Up @@ -275,7 +275,7 @@ void ToteWithReliability::Sort(int n) {
value_[sub] = value_[sub2];
value_[sub2] = tmpv;

double tmps = score_[sub];
int tmps = score_[sub];
score_[sub] = score_[sub2];
score_[sub2] = tmps;

Expand Down
4 changes: 0 additions & 4 deletions tools/valgrind/drmemory/suppressions_full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1163,10 +1163,6 @@ name=http://crbug.com/113847 (2)
*!openDatabase
*!sqlite3_open

UNINITIALIZED READ
name=http://crbug.com/115326
*!ToteWithReliability::Sort

# Some unit tests must not be waiting for the file thread after deleting the
# AppNotificationManager.
LEAK
Expand Down

0 comments on commit 206ca33

Please sign in to comment.