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

Method __Field

src/hx/Anon.cpp:171–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171hx::Val Anon_obj::__Field(const String &inName, hx::PropertyAccess inCallProp)
172{
173
174 #ifdef HX_SMART_STRINGS
175 if (inName.isAsciiEncodedQ())
176 #endif
177 if (mFixedFields>0)
178 {
179 VariantKey *fixed = getFixed();
180 if (inName.__s[HX_GC_CONST_ALLOC_MARK_OFFSET] & HX_GC_CONST_ALLOC_MARK_BIT)
181 {
182 for(int i=0;i<mFixedFields;i++)
183 {
184 if (fixed[i].key.__s == inName.__s)
185 return fixed[i].value;
186 }
187 }
188
189 int hash = inName.hash();
190 if (fixed->hash==hash && HX_QSTR_EQ_AE(fixed->key,inName))
191 return fixed->value;
192 if (mFixedFields>1)
193 {
194 fixed++;
195 if (fixed->hash==hash && HX_QSTR_EQ_AE(fixed->key,inName))
196 return fixed->value;
197 if (mFixedFields>2)
198 {
199 fixed++;
200 if (fixed->hash==hash && HX_QSTR_EQ_AE(fixed->key,inName))
201 return fixed->value;
202 if (mFixedFields>3)
203 {
204 fixed++;
205 if (fixed->hash==hash && HX_QSTR_EQ_AE(fixed->key,inName))
206 return fixed->value;
207 if (mFixedFields>4)
208 {
209 fixed++;
210 if (fixed->hash==hash && HX_QSTR_EQ_AE(fixed->key,inName))
211 return fixed->value;
212
213 int fixed = findFixed(inName,true);
214 if (fixed>=0)
215 return getFixed()[fixed].value;
216 }
217 }
218 }
219 }
220 }
221
222
223 if (!mFields.mPtr)
224 return hx::Val();
225
226 return __string_hash_get(mFields,inName);
227}
228

Callers 2

StringFromAnonFieldsFunction · 0.45
__traceFunction · 0.45

Calls 2

getFixedFunction · 0.85
__string_hash_getFunction · 0.85

Tested by

no test coverage detected