MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / find

Method find

core/variant/array.cpp:368–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

366}
367
368int Array::find(const Variant &p_value, int p_from) const {
369 if (_p->array.is_empty()) {
370 return -1;
371 }
372 Variant value = p_value;
373 ERR_FAIL_COND_V(!_p->typed.validate(value, "find"), -1);
374
375 int ret = -1;
376
377 if (p_from < 0 || size() == 0) {
378 return ret;
379 }
380
381 for (int i = p_from; i < size(); i++) {
382 if (StringLikeVariantComparator::compare(_p->array[i], value)) {
383 ret = i;
384 break;
385 }
386 }
387
388 return ret;
389}
390
391int Array::find_custom(const Callable &p_callable, int p_from) const {
392 int ret = -1;

Callers 15

get_constant_valueMethod · 0.45
get_enum_valueMethod · 0.45
evaluateMethod · 0.45
validated_evaluateMethod · 0.45
ptr_evaluateMethod · 0.45
evaluateMethod · 0.45
validated_evaluateMethod · 0.45
ptr_evaluateMethod · 0.45
evaluateMethod · 0.45
validated_evaluateMethod · 0.45
ptr_evaluateMethod · 0.45
evaluateMethod · 0.45

Calls 2

is_emptyMethod · 0.45
validateMethod · 0.45

Tested by

no test coverage detected