17 -> BUCKET_SIZE
This commit is contained in:
parent
4999fabbcc
commit
a8d9e044d2
@ -406,6 +406,8 @@ public class HttpHeaders {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final int BUCKET_SIZE = 17;
|
||||||
|
|
||||||
private static int hash(String name) {
|
private static int hash(String name) {
|
||||||
int h = 0;
|
int h = 0;
|
||||||
for (int i = name.length() - 1; i >= 0; i --) {
|
for (int i = name.length() - 1; i >= 0; i --) {
|
||||||
@ -449,17 +451,17 @@ public class HttpHeaders {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Entry[] entries = new Entry[17];
|
private static int index(int hash) {
|
||||||
|
return hash % BUCKET_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final Entry[] entries = new Entry[BUCKET_SIZE];
|
||||||
private final Entry head = new Entry(-1, null, null);
|
private final Entry head = new Entry(-1, null, null);
|
||||||
|
|
||||||
HttpHeaders() {
|
HttpHeaders() {
|
||||||
head.before = head.after = head;
|
head.before = head.after = head;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int index(int hash) {
|
|
||||||
return hash % entries.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
void validateHeaderName(String name) {
|
void validateHeaderName(String name) {
|
||||||
HttpCodecUtil.validateHeaderName(name);
|
HttpCodecUtil.validateHeaderName(name);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user