← Back to team overview

kicad-developers team mailing list archive

Still working on TRACK::GetTrack

 

Reworking the function to have the possibility to request a forward-only
search (it needs to be restarted on the next item to reconstruct the
original track cleanup loop, at least how I think it did in the past).

There are two things I'm not sure of, to avoid breaking things:

- Why does it revert to the linear search after 50 iterations? it
  already has checked 100 elements and the boundaries are the same,
  anyway. It has thrown away its chance to find quickly a near segment,
  but the speed of searching is the same on both directions, in
  a dlist;

- Is it correct that it doesn't stops on netcode change? unlike
  BOARD::GetTrack (which is essentially the track picker), from
  a cursory inspection it seems that is only used for same-net work;
  if is meant to choose from other netcodes too I'd add a parameter for
  the 'same net only' behaviour, since a NULL passed as a limit
  essentially means 'all the other tracks on the board', in the worst
  case. In fact, if I didn't look wrong, it's *always* used with NULL as
  the end limit. Other cleanup functions already assume that netcodes
  are corrects, by the way.

Have I missed something?

-- 
Lorenzo Marcantonio
Logos Srl