From 1895b83251b5a5d47445dc31aedea24b1f028aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 26 Mar 2020 17:55:48 +0100 Subject: [PATCH] [python] Remove useless code --- python/port/mod/matplotlib/modpyplot.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/python/port/mod/matplotlib/modpyplot.cpp b/python/port/mod/matplotlib/modpyplot.cpp index 0da285c89..4352a1a74 100644 --- a/python/port/mod/matplotlib/modpyplot.cpp +++ b/python/port/mod/matplotlib/modpyplot.cpp @@ -176,24 +176,6 @@ mp_obj_t modpyplot_grid(size_t n_args, const mp_obj_t *args) { return mp_const_none; } -// Dichotomia to find which bin a value belongs to -size_t belongs_to_bin_of_index(mp_float_t v, mp_obj_t * binsEdges, size_t minIndex, size_t maxIndex) { - assert(mp_obj_get_float(binsEdges[minIndex]) <= v && v <= mp_obj_get_float(binsEdges[maxIndex])); - if (maxIndex - minIndex < 2) { - return minIndex; - } - size_t index = (minIndex+maxIndex)/2; - mp_float_t pivot = mp_obj_get_float(binsEdges[index]); - if (pivot == v) { - return index; - } else if (pivot < v) { - return belongs_to_bin_of_index(v, binsEdges, index, maxIndex); - } else { - assert(pivot > v); - return belongs_to_bin_of_index(v, binsEdges, minIndex, index); - } -} - mp_obj_t modpyplot_hist(mp_obj_t x) { // Create a list of bins // TODO: the number of bins can be given as input