Changeset: e122521b85d6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e122521b85d6
Modified Files:
        monetdb5/mal/mal_instruction.c
Branch: Jun2020
Log Message:

Avoid unnecessary strdup.


diffs (18 lines):

diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c
--- a/monetdb5/mal/mal_instruction.c
+++ b/monetdb5/mal/mal_instruction.c
@@ -1117,10 +1117,10 @@ defConstant(MalBlkPtr mb, int type, ValP
                setVarCleanup(mb, k);
        else
                clrVarCleanup(mb, k);
-       if(VALcopy( &getVarConstant(mb, k),cst) == NULL)
-               return -1;
-       if (ATOMextern(cst->vtype) && cst->val.pval)
-               VALclear(cst);
+       /* if cst is external, we give its allocated buffer away, so clear
+        * it to avoid confusion */
+       getVarConstant(mb, k) = *cst;
+       VALempty(cst);
        return k;
 }
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to