diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-30 22:35:33 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-30 22:35:33 +0000 |
commit | 2f0f25a0536c60c52d7a1357a953775651121ddf (patch) | |
tree | 423cb56e58b55a3b26f47f7fd5286a920075a705 | |
parent | 43ddb30857b4567169f1df3e6090c0dd72ad869a (diff) | |
download | chromium_src-2f0f25a0536c60c52d7a1357a953775651121ddf.zip chromium_src-2f0f25a0536c60c52d7a1357a953775651121ddf.tar.gz chromium_src-2f0f25a0536c60c52d7a1357a953775651121ddf.tar.bz2 |
Coverity: Remove a check for index < 0 because index is size_t and can never be < 0.
CID=5378
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/242084
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27671 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/socket/socket_test_util.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc index cd4423b..b3fbcfe 100644 --- a/net/socket/socket_test_util.cc +++ b/net/socket/socket_test_util.cc @@ -4,6 +4,8 @@ #include "net/socket/socket_test_util.h" +#include <algorithm> + #include "base/basictypes.h" #include "base/compiler_specific.h" #include "base/message_loop.h" @@ -121,7 +123,7 @@ int MockTCPClientSocket::Read(net::IOBuffer* buf, int buf_len, int MockTCPClientSocket::Write(net::IOBuffer* buf, int buf_len, net::CompletionCallback* callback) { DCHECK(buf); - DCHECK(buf_len > 0); + DCHECK_GT(buf_len, 0); DCHECK(!callback_); if (!IsConnected()) @@ -348,7 +350,7 @@ void ClientSocketPoolTest::TearDown() { int ClientSocketPoolTest::GetOrderOfRequest(size_t index) { index--; - if (index < 0 || index >= requests_.size()) + if (index >= requests_.size()) return kIndexOutOfBounds; for (size_t i = 0; i < request_order_.size(); i++) |