Commits


Gil authored and GitHub committed 60e37f32e27
Use three-way comparisons in C++ (#2884) * Remove last traces of Objective-C from document_key.h * Generalize empty base optimization into CompressedMember Remove ComparatorHolder. * Add Comparator<T>.Compare This makes C++ more like the other platforms, where three-way comparison is the default. For now, don't remove the less-than definition of operator()--this allows these comparators to be used in both circumstances. * Remove KeyComparator With the transition between less-than and three-way comparison adapting this class isn't worth it. While technically this is losing use of std::lower_bound, the performance cost is negligible because these arrays are guaranteed to be always small. This also makes ArraySortedMap work more like it does in the other ports. * Add Compare to the remaining Comparators * Migrate remaining comparator usage in immuntable to three-way * Use absl::bit_cast in comparison * Make Comparable depend upon CompareTo. * Use Comparable in more places * Remove Comparator::operator() * Move things around in comparison.h Move: * Objective-C ComparisonResult functions nearer to others * DefaultComparator to above the first specializations * Make Comparison on by default, delegating to CompareTo if available * Move NSString Comparator into comparison.h * Remove no longer required Comparator classes * Make FieldValue support Comparable