MCPcopy Create free account
hub / github.com/Snapchat/Valdi / swap

Method swap

valdi_core/src/valdi_core/cpp/Utils/Marshaller.cpp:269–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267}
268
269void Marshaller::swap(int leftIndex, int rightIndex) {
270 auto resolvedLeftIndex = convertIndexOrError(leftIndex);
271 if (!_exceptionTracker) {
272 return;
273 }
274 auto resolvedRightIndex = convertIndexOrError(rightIndex);
275 if (!_exceptionTracker) {
276 return;
277 }
278
279 std::swap(_stack[resolvedLeftIndex], _stack[resolvedRightIndex]);
280}
281
282ValueType Marshaller::getType(int index) {
283 return getOrUndefinedAsRef(index).getType();

Callers 2

disposeMethod · 0.45
TESTFunction · 0.45

Calls 1

swapFunction · 0.50

Tested by 1

TESTFunction · 0.36