Permalink
Browse files

Fixed a conditional directive (#elif instead of #elseif) and an unuse…

…d variable in quantile_double. Both fixes thanks to Sune Vuorela.
  • Loading branch information...
tvondra committed Mar 28, 2012
1 parent 306ee91 commit 66730b156279f7e65c685af39055bbd002345869
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/quantile.c
View
@@ -35,7 +35,7 @@ PG_MODULE_MAGIC;
elog(ERROR, "%s called in non-aggregate context", fname); \
}
-#elseif (PG_VERSION_NUM >= 80400)
+#elif (PG_VERSION_NUM >= 80400)
#define GET_AGG_CONTEXT(fname, fcinfo, aggcontext) \
if (fcinfo->context && IsA(fcinfo->context, AggState)) { \
@@ -656,7 +656,6 @@ quantile_double(PG_FUNCTION_ARGS)
{
int idx = 0;
- double *result;
struct_double * data;
@@ -668,8 +667,6 @@ quantile_double(PG_FUNCTION_ARGS)
data = (struct_double*)PG_GETARG_POINTER(0);
- result = palloc(data->nquantiles * sizeof(double));
-
qsort(data->elements, data->next, sizeof(double), &double_comparator);
if ((data->quantiles[0] > 0) && (data->quantiles[0] < 1)) {

0 comments on commit 66730b1

Please sign in to comment.