Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a20f72d

Browse files
amcandioeendebakpt
andauthored
Apply suggestions from code review
Co-authored-by: Pieter Eendebak <[email protected]>
1 parent 5fa9c58 commit a20f72d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

benchmarks/benchmarks/bench_searchsorted.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class SearchSortedInt64(Benchmark):
1010
[100, 10_000, 1_000_000, 1_000_000_000], # array sizes
1111
[1, 2, 100, 100_000], # number of query elements
1212
['ordered', 'random'], # query order
13-
[42, 18122022]
13+
[42, 18122022], # seed
1414
]
1515
param_names = ['array_size', 'n_queries', 'query_order', 'seed']
1616

numpy/_core/src/npysort/binsearch.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ binsearch(const char *arr, const char *key, char *ret, npy_intp arr_len,
104104
- cmp(arr[i], key_val) == true for all i < base
105105
- cmp(arr[i], key_val) == false for all i >= base + length
106106
107-
The insertion index candidates are i in range [base, base+length] and
107+
The insertion index candidates are in range [base, base+length] and
108108
on each iteration we shrink the range into either
109109
[base, ceil(length / 2)]
110110
or
@@ -147,8 +147,8 @@ binsearch(const char *arr, const char *key, char *ret, npy_intp arr_len,
147147
}
148148

149149
/*
150-
At this point interval_length == 1, so the candidates are in interval
151-
[base, base + 1].
150+
At this point interval_length == 1, so the candidates are in the
151+
interval [base, base + 1].
152152
153153
We have two options:
154154
If cmp(arr[base], key_val) == true, insertion index is base + 1

0 commit comments

Comments
 (0)