Skip to content

Commit eb47899

Browse files
committed
Update generic.h
It's not making any sense to use typeof(i) to define length, since 'i' is obviously a 'int'. And it's probably not a good idea to put the choose pivot function in a separate file, this will force user to call srand() unnaturally.
1 parent 34909cb commit eb47899

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/generic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace alg
5454
static inline int choose_pivot(int i,int j)
5555
{
5656
assert(j>=i);
57-
typeof(i) length = j - i;
57+
int length = j - i;
5858
return i+(rand()%length);
5959
}
6060

0 commit comments

Comments
 (0)