From 64bfdf34e74b2416845d73f0d543bba462408294 Mon Sep 17 00:00:00 2001 From: Daehyun Kim Date: Thu, 21 Nov 2024 15:02:38 +0900 Subject: [PATCH] refactor(object_domain): remove unnecessary int -> vector conversion and printfs --- src/object/object_domain.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/src/object/object_domain.c b/src/object/object_domain.c index 7fbbc355bd..d868ed523b 100644 --- a/src/object/object_domain.c +++ b/src/object/object_domain.c @@ -7119,12 +7119,6 @@ float* parseFloatArray(const std::string& input, int& outSize) { } } - printf("%d\n", (int)temp.size()); - for (float f : temp) { - printf("%f\n", f); - } - printf("\n"); - // Allocate a dynamic array and copy values from the vector outSize = temp.size(); float* result(new float[outSize]); @@ -7473,14 +7467,6 @@ tp_value_cast_internal (const DB_VALUE * src, DB_VALUE * dest, const TP_DOMAIN * } } - float * vimkim = new float[6]; - vimkim[0] = 1.0; - vimkim[1] = 3.0; - vimkim[2] = 5.0; - vimkim[3] = 6.0; - vimkim[4] = 1.0; - vimkim[5] = 2.0; - switch (desired_type) { case DB_TYPE_SHORT: @@ -7586,20 +7572,15 @@ tp_value_cast_internal (const DB_VALUE * src, DB_VALUE * dest, const TP_DOMAIN * case DB_TYPE_VIMKIM: switch (original_type) { - case DB_TYPE_INTEGER: - // todo: memory leak - db_make_vimkim(target, vimkim, 6); - break; case DB_TYPE_CHAR: { - const char *str = db_get_string(src); - - int size; - auto farray = parseFloatArray(std::string(str), size); + const char *str = db_get_string(src); + int size; + auto farray = parseFloatArray(std::string(str), size); - db_make_vimkim(target, farray, (int)size); - break; + db_make_vimkim(target, farray, (int)size); + break; } default: status = DOMAIN_INCOMPATIBLE;