MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / AddRuneToString

Method AddRuneToString

extern/re2/re2/regexp.cc:171–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void Regexp::AddRuneToString(Rune r) {
172 DCHECK(op_ == kRegexpLiteralString);
173 if (nrunes_ == 0) {
174 // start with 8
175 runes_ = new Rune[8];
176 } else if (nrunes_ >= 8 && (nrunes_ & (nrunes_ - 1)) == 0) {
177 // double on powers of two
178 Rune *old = runes_;
179 runes_ = new Rune[nrunes_ * 2];
180 for (int i = 0; i < nrunes_; i++)
181 runes_[i] = old[i];
182 delete[] old;
183 }
184
185 runes_[nrunes_++] = r;
186}
187
188Regexp* Regexp::HaveMatch(int match_id, ParseFlags flags) {
189 Regexp* re = new Regexp(kRegexpHaveMatch, flags);

Callers 2

MaybeConcatStringMethod · 0.80
LiteralStringMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected