diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-01-11 09:37:41 +0000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-01-11 09:37:41 +0000 |
| commit | 8d4ccc49ed8bca34579982a5a96b2b50da86d985 (patch) | |
| tree | c22ac1b289b0011578164e235e5ae4b152ae567c /py/objlist.c | |
| parent | 25042b19d2310260e22d54ba09a124d5aaf4f512 (diff) | |
| parent | 683466e55f2221cbd6b05106732c885bd324bc21 (diff) | |
Merge branch 'master' of github.com:dpgeorge/micropython
Diffstat (limited to 'py/objlist.c')
| -rw-r--r-- | py/objlist.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/objlist.c b/py/objlist.c index ce55aa510..7d0402d28 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -143,8 +143,8 @@ static void mp_quicksort(mp_obj_t *head, mp_obj_t *tail, mp_obj_t key_fn, bool r mp_obj_t *t = tail; mp_obj_t v = key_fn == NULL ? tail[0] : rt_call_function_1(key_fn, tail[0]); // get pivot using key_fn for (;;) { - do ++h; while (rt_compare_op(op, key_fn == NULL ? h[0] : rt_call_function_1(key_fn, h[0]), v) == mp_const_true); - do --t; while (h < t && rt_compare_op(op, v, key_fn == NULL ? t[0] : rt_call_function_1(key_fn, t[0])) == mp_const_true); + do ++h; while (rt_binary_op(op, key_fn == NULL ? h[0] : rt_call_function_1(key_fn, h[0]), v) == mp_const_true); + do --t; while (h < t && rt_binary_op(op, v, key_fn == NULL ? t[0] : rt_call_function_1(key_fn, t[0])) == mp_const_true); if (h >= t) break; mp_obj_t x = h[0]; h[0] = t[0]; |
