From: Carlos Lopez Date: Mon, 5 Jul 2010 15:11:35 +0000 (+0200) Subject: Remove unused code. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=49e15991766546752224f3770a08f9b296819f48;p=synfig.git Remove unused code. * binary_find is implemented in ETC/misc.h. * Remove code that use old distance calculation. * Remove code once the const cast is used for const members. --- diff --git a/synfig-core/src/synfig/valuenode_animated.cpp b/synfig-core/src/synfig/valuenode_animated.cpp index 3e7e444..e8fb7a6 100644 --- a/synfig-core/src/synfig/valuenode_animated.cpp +++ b/synfig-core/src/synfig/valuenode_animated.cpp @@ -62,24 +62,7 @@ using namespace synfig; /* === M A C R O S ========================================================= */ -// Fast binary search implementation -/* -template inline I -binary_find(I begin, I end, const T& value) -{ - I iter(begin+(end-begin)/2); - - while(end-begin>1 && !(*iter==value)) - { - ((*iter String tangent_info(T a, T b, T v) { return "..."; @@ -148,10 +131,6 @@ struct magnitude : public std::unary_function } }; - - - - template struct is_angle_type { @@ -770,7 +749,10 @@ ValueNode_Animated::find(const Time& begin,const Time& end,std::vectorget_time()get_time()-time) - closest=prev; - else - closest=next; - - for(iter=waypoint_list().begin();iter!=waypoint_list().end();++iter) - { - const Real dist(abs(iter->get_time()-time)); - if(distget_time()-time)) - closest=iter; - } - */ - if(has_prev && !prev->is_static()) waypoint.set_value_node(prev->get_value_node()); if(has_next && !next->is_static()) @@ -865,11 +827,6 @@ ValueNode_Animated::new_waypoint_at_time(const Time& time)const else waypoint.set_value((*this)(time)); - /*if(has_prev) - waypoint.set_after(prev->get_before()); - if(has_next) - waypoint.set_before(next->get_after()); - */ } } waypoint.set_time(time); @@ -894,13 +851,6 @@ ValueNode_Animated::WaypointList::const_iterator ValueNode_Animated::find(const UniqueID &x)const { return const_cast(this)->find(x); - /* - ValueNode_Animated::WaypointList::const_iterator iter; - iter=std::find(waypoint_list().begin(),waypoint_list().end(),x); - if(iter!=waypoint_list().end() && iter->get_uid()!=x.get_uid()) - throw Exception::NotFound(strprintf("ValueNode_Animated::find()const: Can't find UniqueID %d",x.get_uid())); - return iter; - */ } ValueNode_Animated::WaypointList::iterator @@ -918,14 +868,6 @@ ValueNode_Animated::WaypointList::const_iterator ValueNode_Animated::find(const Time &x)const { return const_cast(this)->find(x); - /* - WaypointList::const_iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x)); - - if(iter!=waypoint_list().end() && x.is_equal(iter->get_time())) - return iter; - - throw Exception::NotFound(strprintf("ValueNode_Animated::find(): Can't find Waypoint at %s",x.get_string().c_str())); - */ } ValueNode_Animated::WaypointList::iterator @@ -949,20 +891,6 @@ ValueNode_Animated::WaypointList::const_iterator ValueNode_Animated::find_next(const Time &x)const { return const_cast(this)->find_next(x); - /* - WaypointList::const_iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x)); - - if(iter!=waypoint_list().end()) - { - if(iter->get_time()-Time::epsilon()>x) - return iter; - ++iter; - if(iter!=waypoint_list().end() && iter->get_time()-Time::epsilon()>x) - return iter; - } - - throw Exception::NotFound(strprintf("ValueNode_Animated::find_next(): Can't find Waypoint after %s",x.get_string().c_str())); -*/ } ValueNode_Animated::WaypointList::iterator @@ -985,18 +913,6 @@ ValueNode_Animated::WaypointList::const_iterator ValueNode_Animated::find_prev(const Time &x)const { return const_cast(this)->find_prev(x); - /* - WaypointList::const_iterator iter(binary_find(waypoint_list().begin(),waypoint_list().end(),x)); - - if(iter!=waypoint_list().end()) - { - if(iter->get_time()+Time::epsilon()get_time()+Time::epsilon()