diff options
author | poke1024 <poke1024@gmx.de> | 2017-11-02 19:04:38 +0100 |
---|---|---|
committer | Bernhard Liebl <Bernhard.Liebl@gmx.org> | 2017-11-21 08:50:31 +0100 |
commit | d6e54de50239e8ac1de645bd411eeddbf627e4dc (patch) | |
tree | a8ac54ac05e8b13daca8eb78c8235ca934180507 /core/variant_call.cpp | |
parent | 7c90d51b729d31557ad6d45a5fe18d11f6752cf1 (diff) | |
download | redot-engine-d6e54de50239e8ac1de645bd411eeddbf627e4dc.tar.gz |
Add bsearch and bsearch_custom to Array
Diffstat (limited to 'core/variant_call.cpp')
-rw-r--r-- | core/variant_call.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/variant_call.cpp b/core/variant_call.cpp index 9e6aaeb911..da6e602ccb 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -483,6 +483,8 @@ struct _VariantCall { VCALL_LOCALMEM1(Array, erase); VCALL_LOCALMEM0(Array, sort); VCALL_LOCALMEM2(Array, sort_custom); + VCALL_LOCALMEM2R(Array, bsearch); + VCALL_LOCALMEM4R(Array, bsearch_custom); VCALL_LOCALMEM0R(Array, duplicate); VCALL_LOCALMEM0(Array, invert); @@ -1625,6 +1627,8 @@ void register_variant_methods() { ADDFUNC0RNC(ARRAY, NIL, Array, pop_front, varray()); ADDFUNC0NC(ARRAY, NIL, Array, sort, varray()); ADDFUNC2NC(ARRAY, NIL, Array, sort_custom, OBJECT, "obj", STRING, "func", varray()); + ADDFUNC2R(ARRAY, INT, Array, bsearch, NIL, "value", BOOL, "before", varray(true)); + ADDFUNC4R(ARRAY, INT, Array, bsearch_custom, NIL, "value", OBJECT, "obj", STRING, "func", BOOL, "before", varray(true)); ADDFUNC0NC(ARRAY, NIL, Array, invert, varray()); ADDFUNC0RNC(ARRAY, ARRAY, Array, duplicate, varray()); |