diff --git a/python/port/mod/matplotlib/pyplot/plot_store.cpp b/python/port/mod/matplotlib/pyplot/plot_store.cpp index 931aa3c29..e772d407b 100644 --- a/python/port/mod/matplotlib/pyplot/plot_store.cpp +++ b/python/port/mod/matplotlib/pyplot/plot_store.cpp @@ -56,15 +56,6 @@ T PlotStore::ListIterator::operator*() { return T(m_tuples[m_tupleIndex]); }; -void checkFloatType(mp_obj_t * elements, size_t nbOfElements) { - for (size_t i = 0; i < nbOfElements; i++) { - // TODO: we don't take advantage of the fact that we extracted the value at the sametime... Maybe change the way things are done, build the c objects in addItem instead of allocating them on the python heap? Or use float array in python? - mp_float_t value; - if (!mp_obj_get_float_maybe(elements[i], &value)) { - mp_raise_TypeError("argument should be a number"); - } - } -} // Dot @@ -81,7 +72,6 @@ PlotStore::Dot::Dot(mp_obj_t tuple) { void PlotStore::addDot(mp_obj_t x, mp_obj_t y, KDColor c) { mp_obj_t color = mp_obj_new_int(c); mp_obj_t items[3] = {x, y, color}; - checkFloatType(items, 2); mp_obj_t tuple = mp_obj_new_tuple(3, items); mp_obj_list_append(m_dots, tuple); } @@ -104,7 +94,6 @@ PlotStore::Segment::Segment(mp_obj_t tuple) { void PlotStore::addSegment(mp_obj_t xStart, mp_obj_t yStart, mp_obj_t xEnd, mp_obj_t yEnd, KDColor c, mp_obj_t arrowWidth) { mp_obj_t color = mp_obj_new_int(c); mp_obj_t items[6] = {xStart, yStart, xEnd, yEnd, arrowWidth, color}; - checkFloatType(items, 5); mp_obj_t tuple = mp_obj_new_tuple(6, items); mp_obj_list_append(m_segments, tuple); } @@ -126,7 +115,6 @@ PlotStore::Rect::Rect(mp_obj_t tuple) { void PlotStore::addRect(mp_obj_t left, mp_obj_t right, mp_obj_t top, mp_obj_t bottom, KDColor c) { mp_obj_t color = mp_obj_new_int(c); mp_obj_t items[5] = {left, right, top, bottom, color}; - checkFloatType(items, 4); mp_obj_t tuple = mp_obj_new_tuple(5, items); mp_obj_list_append(m_rects, tuple); } @@ -145,7 +133,6 @@ PlotStore::Label::Label(mp_obj_t tuple) { void PlotStore::addLabel(mp_obj_t x, mp_obj_t y, mp_obj_t string) { mp_obj_t items[3] = {x, y, string}; - checkFloatType(items, 2); if (!mp_obj_is_str(string)) { mp_raise_TypeError("argument should be a string"); }