Restore TomcatHeadersAdapter.clear() behavior
This commit restores the original behavior of the clear() method in TomcatHeadersAdapter by delegating to org.apache.tomcat.util.http.MimeHeaders.recycle(), which aligns with the memory efficiency goals documented in the class-level Javadoc for MimeHeaders. See gh-33916 Closes gh-34092
This commit is contained in:
@@ -163,9 +163,7 @@ class TomcatHeadersAdapter implements MultiValueMap<String, String> {
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
while (this.headers.size() > 0) {
|
||||
this.headers.removeHeader(0);
|
||||
}
|
||||
this.headers.recycle();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user