refactor: move bsearch function to C-code (#2945)
This commit fixes issue #527 and move the bsearch function to a native C-code. This change improves the performance of this function.
This commit is contained in:
1 parent
18bd8374c1
commit
562ffec869
3 files changed
+46
-32
No files matched your search
+11
-1
@@ -1642,12 +1642,22 @@ ascii_upcase
|
||||
"useful but not for é"
|
||||
"USEFUL BUT NOT FOR é"
|
||||
|
||||
bsearch(0,2,4)
|
||||
bsearch(0,1,2,3,4)
|
||||
[1,2,3]
|
||||
-1
|
||||
0
|
||||
1
|
||||
2
|
||||
-4
|
||||
|
||||
bsearch({x:1})
|
||||
[{ "x": 0 },{ "x": 1 },{ "x": 2 }]
|
||||
1
|
||||
|
||||
try ["OK", bsearch(0)] catch ["KO",.]
|
||||
"aa"
|
||||
["KO","string (\"aa\") cannot be searched from"]
|
||||
|
||||
# strptime tests are in optional.test
|
||||
|
||||
strftime("%Y-%m-%dT%H:%M:%SZ")
|
||||
|
||||
Reference in new issue
Block a user