You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2015/06/09 17:37:07 UTC

trafficserver git commit: TS-3444 Eliminate checks after assert. CID #1271336

Repository: trafficserver
Updated Branches:
  refs/heads/master 470e8a981 -> dcb39f9aa


TS-3444 Eliminate checks after assert. CID #1271336


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/dcb39f9a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/dcb39f9a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/dcb39f9a

Branch: refs/heads/master
Commit: dcb39f9aa6e1701a9f7b432324165bacdde6e259
Parents: 470e8a9
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sun May 24 20:33:25 2015 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Jun 9 09:36:38 2015 -0600

----------------------------------------------------------------------
 proxy/http2/Http2ConnectionState.h | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dcb39f9a/proxy/http2/Http2ConnectionState.h
----------------------------------------------------------------------
diff --git a/proxy/http2/Http2ConnectionState.h b/proxy/http2/Http2ConnectionState.h
index 6a97690..d51c67b 100644
--- a/proxy/http2/Http2ConnectionState.h
+++ b/proxy/http2/Http2ConnectionState.h
@@ -59,22 +59,16 @@ public:
   unsigned
   get(Http2SettingsIdentifier id) const
   {
-    ink_assert(id <= HTTP2_SETTINGS_MAX - 1);
+    ink_assert(id < HTTP2_SETTINGS_MAX);
 
-    if (id > HTTP2_SETTINGS_MAX - 1) {
-      return 0;
-    }
     return this->settings[indexof(id)];
   }
 
   unsigned
   set(Http2SettingsIdentifier id, unsigned value)
   {
-    ink_assert(id <= HTTP2_SETTINGS_MAX - 1);
+    ink_assert(id < HTTP2_SETTINGS_MAX);
 
-    if (id > HTTP2_SETTINGS_MAX - 1) {
-      return 0;
-    }
     return this->settings[indexof(id)] = value;
   }
 
@@ -83,7 +77,7 @@ private:
   static unsigned
   indexof(Http2SettingsIdentifier id)
   {
-    ink_assert(id <= HTTP2_SETTINGS_MAX - 1);
+    ink_assert(id < HTTP2_SETTINGS_MAX);
 
     return id - 1;
   }