Hpack optimizations

If the dynamic table size is already 0, do not evictAll.

Signed-off-by: Greg Wilkins <gregw@webtide.com>
This commit is contained in:
Greg Wilkins 2020-05-20 10:47:23 +02:00
parent 3215e11b3f
commit 3845790c5d
1 changed files with 9 additions and 6 deletions

View File

@ -395,12 +395,15 @@ public class HpackContext
{ {
if (LOG.isDebugEnabled()) if (LOG.isDebugEnabled())
LOG.debug(String.format("HdrTbl[%x] evictAll", HpackContext.this.hashCode())); LOG.debug(String.format("HdrTbl[%x] evictAll", HpackContext.this.hashCode()));
_fieldMap.clear(); if (size() > 0)
_nameMap.clear(); {
_offset = 0; _fieldMap.clear();
_size = 0; _nameMap.clear();
_dynamicTableSizeInBytes = 0; _offset = 0;
Arrays.fill(_entries, null); _size = 0;
_dynamicTableSizeInBytes = 0;
Arrays.fill(_entries, null);
}
} }
} }