Changeset: 53877c5b461c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=53877c5b461c
Modified Files:
        sql/server/sql_atom.c
Branch: Jul2012
Log Message:

Remove useless variable.
Found by coverity.


diffs (31 lines):

diff --git a/sql/server/sql_atom.c b/sql/server/sql_atom.c
--- a/sql/server/sql_atom.c
+++ b/sql/server/sql_atom.c
@@ -663,14 +663,13 @@ atom_cast(atom *a, sql_subtype *tp)
                    at->type->localtype >= tp->type->localtype &&
                    at->digits >= tp->digits && 
                        (at->digits - tp->digits) == (at->scale - tp->scale)) {
-                       lng mul = 1, div = 0, rnd = 0, val = 0;
+                       lng mul = 1, rnd = 0, val = 0;
 
                        /* fix scale */
 
                        /* only round when going to a lower scale */
                        mul = scales[at->scale-tp->scale];
                        rnd = mul>>1;
-                       div = 1;
 
                        if (a->data.vtype == TYPE_lng) {
                                val = a->data.val.lval;
@@ -683,10 +682,7 @@ atom_cast(atom *a, sql_subtype *tp)
                        }
 
                        val += rnd;
-                       if (div)
-                               val /= mul;
-                       else
-                               val *= mul;
+                       val /= mul;
 
                        a->tpe = *tp;
                        a->data.vtype = tp->type->localtype;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to