From 1545d2d134c542a19ec4fe2a5a3381d8f12b9320 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 23 Mar 2011 01:23:25 +1300 Subject: [PATCH] ICC: dead code removal --- src/HttpHeader.cc | 15 +++++++-------- src/String.cc | 3 ++- src/store.cc | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 82f2c6b8df..b4488024c3 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -1740,15 +1740,14 @@ httpHeaderStoreReport(StoreEntry * e) http_hdr_type httpHeaderIdByName(const char *name, size_t name_len, const HttpHeaderFieldInfo * info, int end) { - int i; - - for (i = 0; i < end; ++i) { - if (name_len >= 0 && name_len != info[i].name.size()) - continue; + if (name_len > 0) { + for (int i = 0; i < end; ++i) { + if (name_len != info[i].name.size()) + continue; - if (!strncasecmp(name, info[i].name.termedBuf(), - name_len < 0 ? info[i].name.size() + 1 : name_len)) - return info[i].id; + if (!strncasecmp(name, info[i].name.rawBuf(), name_len)) + return info[i].id; + } } return HDR_BAD_HDR; diff --git a/src/String.cc b/src/String.cc index bf4366cf65..e295d521ef 100644 --- a/src/String.cc +++ b/src/String.cc @@ -248,7 +248,8 @@ String::absorb(String &old) String String::substr(String::size_type from, String::size_type to) const { - Must(from >= 0 && from < size()); +// Must(from >= 0 && from < size()); + Must(from < size()); Must(to > 0 && to <= size()); Must(to > from); diff --git a/src/store.cc b/src/store.cc index af732464eb..a9d24db0d9 100644 --- a/src/store.cc +++ b/src/store.cc @@ -812,7 +812,6 @@ void StoreEntry::write (StoreIOBuffer writeBuffer) { assert(mem_obj != NULL); - assert(writeBuffer.length >= 0); /* This assert will change when we teach the store to update */ PROF_start(StoreEntry_write); assert(store_status == STORE_PENDING); -- 2.47.3