OLD | NEW |
1 /* C++ code produced by gperf version 3.0.3 */ | 1 /* C++ code produced by gperf version 3.0.3 */ |
2 /* Command-line: gperf -a -L C++ -C -c -o -t -k '*' -NFindDomain -ZPerfect_Hash_
Test2 -D -T effective_tld_names_unittest2.gperf */ | 2 /* Command-line: gperf -a -L C++ -C -c -o -t -k '*' -NFindDomain -ZPerfect_Hash_
Test2 -D -T effective_tld_names_unittest2.gperf */ |
3 | 3 |
4 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ | 4 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ |
5 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ | 5 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ |
6 && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ | 6 && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ |
7 && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ | 7 && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ |
8 && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ | 8 && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ |
9 && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ | 9 && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ |
10 && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ | 10 && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 break; | 109 break; |
110 } | 110 } |
111 return hval; | 111 return hval; |
112 } | 112 } |
113 | 113 |
114 const struct DomainRule * | 114 const struct DomainRule * |
115 Perfect_Hash_Test2::FindDomain (register const char *str, register unsigned int
len) | 115 Perfect_Hash_Test2::FindDomain (register const char *str, register unsigned int
len) |
116 { | 116 { |
117 static const struct DomainRule wordlist[] = | 117 static const struct DomainRule wordlist[] = |
118 { | 118 { |
119 #line 15 "effective_tld_names_unittest2.gperf" | |
120 {"jp", 0}, | |
121 #line 16 "effective_tld_names_unittest2.gperf" | 119 #line 16 "effective_tld_names_unittest2.gperf" |
122 {"bar.jp", 0} | 120 {"jp", 0, false}, |
| 121 #line 17 "effective_tld_names_unittest2.gperf" |
| 122 {"bar.jp", 0, false} |
123 }; | 123 }; |
124 | 124 |
125 static const signed char lookup[] = | 125 static const signed char lookup[] = |
126 { | 126 { |
127 -1, -1, 0, -1, -1, -1, 1 | 127 -1, -1, 0, -1, -1, -1, 1 |
128 }; | 128 }; |
129 | 129 |
130 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) | 130 if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
131 { | 131 { |
132 register int key = hash (str, len); | 132 register int key = hash (str, len); |
133 | 133 |
134 if (key <= MAX_HASH_VALUE && key >= 0) | 134 if (key <= MAX_HASH_VALUE && key >= 0) |
135 { | 135 { |
136 register int index = lookup[key]; | 136 register int index = lookup[key]; |
137 | 137 |
138 if (index >= 0) | 138 if (index >= 0) |
139 { | 139 { |
140 register const char *s = wordlist[index].name; | 140 register const char *s = wordlist[index].name; |
141 | 141 |
142 if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] ==
'\0') | 142 if (*str == *s && !strncmp (str + 1, s + 1, len - 1) && s[len] ==
'\0') |
143 return &wordlist[index]; | 143 return &wordlist[index]; |
144 } | 144 } |
145 } | 145 } |
146 } | 146 } |
147 return 0; | 147 return 0; |
148 } | 148 } |
149 #line 17 "effective_tld_names_unittest2.gperf" | 149 #line 18 "effective_tld_names_unittest2.gperf" |
150 | 150 |
OLD | NEW |