]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ICC: dead code removal
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 22 Mar 2011 12:23:25 +0000 (01:23 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 22 Mar 2011 12:23:25 +0000 (01:23 +1300)
src/HttpHeader.cc
src/String.cc
src/store.cc

index 82f2c6b8df700a8255c4158b01424d23a6b0b674..b4488024c33c416fe1c4f69e7a7677a8b04f98be 100644 (file)
@@ -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;
index bf4366cf656f3d7fa989e8bbdeafdee953a0987e..e295d521ef2f79e4ce249e6e68b1ec0034e24163 100644 (file)
@@ -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);
 
index af732464eb7c999ebc8fcdfeefb2ca0130f5cba7..a9d24db0d94af3737467eea76a63fe3970a404d3 100644 (file)
@@ -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);