MCPcopy Create free account
hub / github.com/antlr/codebuff / matches

Method matches

output/java_guava/1.4.13/SmallCharMatcher.java:116–138  ·  view source on GitHub ↗
(char c)

Source from the content-addressed store, hash-verified

114 }
115
116 @Override
117 public boolean matches(char c) {
118 if (c == 0) {
119 return containsZero;
120 }
121 if (!checkFilter(c)) {
122 return false;
123 }
124 int mask = table.length - 1;
125 int startingIndex = smear(c) & mask;
126 int index = startingIndex;
127 do {
128 if (table[index] == 0) { // Check for empty.
129 return false;
130 } else if (table[index] == c) { // Check for match.
131 return true;
132 } else { // Linear probing.
133 index = (index + 1) & mask;
134 }
135 // Check to see if we wrapped around the whole table.
136 } while (index != startingIndex);
137 return false;
138 }
139
140 @Override
141 void setBits(BitSet table) {

Callers

nothing calls this directly

Calls 2

checkFilterMethod · 0.95
smearMethod · 0.95

Tested by

no test coverage detected