From 0b9f22b248f3d07523b324331cd592c36faebdb7 Mon Sep 17 00:00:00 2001 From: Vinicius Roque Date: Mon, 29 Nov 2021 15:32:03 -0300 Subject: [PATCH] Remove std swap function --- cpp/src/gandiva/precompiled/string_ops.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cpp/src/gandiva/precompiled/string_ops.cc b/cpp/src/gandiva/precompiled/string_ops.cc index 37ca0c1a038cb..ec64b254ac613 100644 --- a/cpp/src/gandiva/precompiled/string_ops.cc +++ b/cpp/src/gandiva/precompiled/string_ops.cc @@ -1693,6 +1693,7 @@ gdv_int32 levenshtein(int64_t context, const char* in1, int32_t in1_len, const c // v1 -> (in2_len+1, ..., &ptr[in2_len * 2]) int* v0; int* v1; + int* aux; v0 = &ptr[0]; v1 = &ptr[len_smaller + 1]; @@ -1733,7 +1734,9 @@ gdv_int32 levenshtein(int64_t context, const char* in1, int32_t in1_len, const c } // Swaping v0 and v1 - std::swap(v0, v1); + aux = v0; + v0 = v1; + v1 = aux; } // The results of v1 are now in v0, Levenshtein value is in v0[n] int result = v0[len_smaller];