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

Method Swap

extern/re2/re2/regexp.cc:335–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335void Regexp::Swap(Regexp* that) {
336 // Regexp is not trivially copyable, so we cannot freely copy it with
337 // memmove(3), but swapping objects like so is safe for our purposes.
338 char tmp[sizeof *this];
339 void* vthis = reinterpret_cast<void*>(this);
340 void* vthat = reinterpret_cast<void*>(that);
341 memmove(tmp, vthis, sizeof *this);
342 memmove(vthis, vthat, sizeof *this);
343 memmove(vthat, tmp, sizeof *this);
344}
345
346// Tests equality of all top-level structure but not subregexps.
347static bool TopEqual(Regexp* a, Regexp* b) {

Callers 1

RemoveLeadingStringMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected