From 4877f72a75f9cc06c369d6a88b3b42ac7afbb104 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 11 Mar 2015 00:42:18 +0900 Subject: [PATCH] nghttpx: Optimize a bit --- src/shrpx_http2_session.cc | 4 ++-- src/shrpx_http2_session.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index 66b9595b..05bf62f9 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -208,9 +208,9 @@ int Http2Session::disconnect(bool hard) { // this object. In order to achieve this, we first swap dconns_ and // streams_. Upstream::on_downstream_reset() may add // Http2DownstreamConnection. - std::set dconns; + std::unordered_set dconns; dconns.swap(dconns_); - std::set streams; + std::unordered_set streams; streams.swap(streams_); std::set handlers; diff --git a/src/shrpx_http2_session.h b/src/shrpx_http2_session.h index 10d056a6..e9ac37d2 100644 --- a/src/shrpx_http2_session.h +++ b/src/shrpx_http2_session.h @@ -27,7 +27,7 @@ #include "shrpx.h" -#include +#include #include #include @@ -188,8 +188,8 @@ private: // connection check has started, this timer is started again and // traps PING ACK timeout. ev_timer connchk_timer_; - std::set dconns_; - std::set streams_; + std::unordered_set dconns_; + std::unordered_set streams_; std::function read_, write_; std::function on_read_, on_write_; // Used to parse the response from HTTP proxy