From 3bbb05f59b2d2f959a84eac3a85cb6c07e3717d9 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 20 Nov 2015 00:19:02 +0900 Subject: [PATCH] Optimize the case when only weight is changed --- lib/nghttp2_session.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/nghttp2_session.c b/lib/nghttp2_session.c index de65867b..411fa7ab 100644 --- a/lib/nghttp2_session.c +++ b/lib/nghttp2_session.c @@ -660,6 +660,11 @@ int nghttp2_session_reprioritize_stream( } } + if (dep_stream == stream->dep_prev && !pri_spec->exclusive) { + stream->weight = pri_spec->weight; + return 0; + } + nghttp2_stream_dep_remove_subtree(stream); /* We have to update weight after removing stream from tree */