MCPcopy Create free account
hub / github.com/catboost/catboost / Compare

Method Compare

util/generic/bitmap.h:909–930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

907 }
908
909 int Compare(const TThis& bitmap) const {
910 size_t size = Min(Mask.GetChunkCapacity(), bitmap.Mask.GetChunkCapacity());
911 int res = ::memcmp(Mask.Data, bitmap.Mask.Data, size * sizeof(TChunk));
912 if (0 != res || Mask.GetChunkCapacity() == bitmap.Mask.GetChunkCapacity()) {
913 return res;
914 }
915
916 if (Mask.GetChunkCapacity() > bitmap.Mask.GetChunkCapacity()) {
917 for (size_t i = bitmap.Mask.GetChunkCapacity(); i < Mask.GetChunkCapacity(); ++i) {
918 if (0 != Mask.Data[i]) {
919 return 1;
920 }
921 }
922 } else {
923 for (size_t i = Mask.GetChunkCapacity(); i < bitmap.Mask.GetChunkCapacity(); ++i) {
924 if (0 != bitmap.Mask.Data[i]) {
925 return -1;
926 }
927 }
928 }
929 return 0;
930 }
931
932 template <class T>
933 Y_FORCE_INLINE int Compare(const TBitMapOps<T>& bitmap) const {

Callers

nothing calls this directly

Calls 4

memcmpFunction · 0.85
MinFunction · 0.70
CompareFunction · 0.50
GetChunkCapacityMethod · 0.45

Tested by

no test coverage detected