zabbix-agent2/src/libs/zbxserver/evalfunc.c
/* specialized versions of zbx_vector_history_record_*_uniq() because */
/* standard versions do not release memory occupied by duplicate elements */
specialized versions of zbx_vector_history_record_*_uniq() because
standard versions do not release memory occupied by duplicate elements
specialized versions of zbx_vector_history_record_ * _uniq () because standard versions do not release memory occupied by duplicate elements
static void	zbx_vector_history_record_str_uniq(zbx_vector_history_record_t *vector, zbx_compare_func_t compare_func)
{
	if (2 <= vector->values_num)
	{
		int	i = 0, j = 1;
		while (j < vector->values_num)
		{
			if (0 != compare_func(&vector->values[i], &vector->values[j]))
			{
				i++;
				j++;
			}
			else
			{
				zbx_free(vector->values[j].value.str);
				zbx_vector_history_record_remove(vector, j);
			}
		}
	}
}
static void zbx_vector_history_record_str_uniq ( zbx_vector_history_record_t * vector , zbx_compare_func_t compare_func ) { if ( 2 <= vector -> values_num ) { int i = 0 , j = 1 ; while ( j < vector -> values_num ) { if ( 0 != compare_func ( & vector -> values [ i ] , & vector -> values [ j ] ) ) { i ++ ; j ++ ; } else { zbx_free ( vector -> values [ j ] . value . str ) ; zbx_vector_history_record_remove ( vector , j ) ; } } } }
specialized versions of zbx_vector_history_record_*_uniq() because
standard versions do not release memory occupied by duplicate elements
specialized versions of zbx_vector_history_record_ * _uniq () because standard versions do not release memory occupied by duplicate elements