MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / __Compare

Method __Compare

src/Enum.cpp:51–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51int EnumBase_obj::__Compare(const hx::Object *inRHS) const
52{
53 if (inRHS->__GetType()!=vtEnum) return -1;
54 const EnumBase_obj *rhs = static_cast<const EnumBase_obj *>(inRHS);
55
56 if (_hx_tag!=rhs->_hx_tag || GetEnumName()!=rhs->GetEnumName()) return -1;
57 if (mFixedFields!=rhs->mFixedFields) return -1;
58 if (!mFixedFields) return 0;
59
60 const cpp::Variant *f0 = _hx_getFixed();
61 const cpp::Variant *f1 = rhs->_hx_getFixed();
62 for(int i=0;i<mFixedFields;i++)
63 if ( f0[i] != f1[i])
64 return -1;
65
66 return 0;
67}
68
69bool __hxcpp_enum_eq( ::hx::EnumBase a, ::hx::EnumBase b)
70{

Callers

nothing calls this directly

Calls 4

GetEnumNameFunction · 0.85
_hx_getFixedFunction · 0.85
GetEnumNameMethod · 0.80
__GetTypeMethod · 0.45

Tested by

no test coverage detected