-
Knut Anders Hatlen authored
Do some cleanup of the classes in the Item_sum_hybrid class hierarchy, which is where the MIN and MAX aggregate functions are implemented. Item_sum_min and Item_sum_max have some functions that are very similar, only differing in whether they use greater than or less than when comparing values. Moved these functions to Item_sum_hybrid to reduce duplication. Replaced Item_sum_hybrid::cmp_sign (an int) with a bool which tells if the instance represents the MIN or the MAX function. Restructured the min_max_update_*_field functions so that they all have the same structure. Also made sure that store() was only called if a new min/max value was seen. (Previously, some of them stored a value on every call.) Make all of Item_sum_hybrid's member variables private. Change-Id: Ic650b2338a1348d7cdf5f78ccc9fc5e65032ddae
Knut Anders Hatlen authoredDo some cleanup of the classes in the Item_sum_hybrid class hierarchy, which is where the MIN and MAX aggregate functions are implemented. Item_sum_min and Item_sum_max have some functions that are very similar, only differing in whether they use greater than or less than when comparing values. Moved these functions to Item_sum_hybrid to reduce duplication. Replaced Item_sum_hybrid::cmp_sign (an int) with a bool which tells if the instance represents the MIN or the MAX function. Restructured the min_max_update_*_field functions so that they all have the same structure. Also made sure that store() was only called if a new min/max value was seen. (Previously, some of them stored a value on every call.) Make all of Item_sum_hybrid's member variables private. Change-Id: Ic650b2338a1348d7cdf5f78ccc9fc5e65032ddae
Loading