Now that I look at it I see that the whole section was the force bit. Normally when someone does a force the code looks like: if {normalcase || force} So not looking carefully I thought there was a typo.
But just a separate point maybe you should change it to: if {$force && [lsearch [image names] my_pic] != -1} { because the normal case is that force will be 0, so that code will not get run most times. But what will happen in the normal case is it will do a search through a list (slow) and then check a binary value (fast), but if you switch it the other way around it will check the binary value see it fails and then skip the list search.. ie at run time, if this occurs: if { 0 && anything } the anything wont even get checked because the computer already knows the test will fail... Lio. PS I did notice that the image delete would have failed if you changed the && to an || but thought you would realise that and put it into a catch like the following line. ----- Original Message From: "Vivia Nikolaidou" ----- > > Thanx Arieh, but, > > Now it's just a minimal fix to avoid having the DP of the previous account > there. I am thinking about optimizing it even more, to avoid flickering of > the top part when updating the CL. ($force is 1 only when you call it > right after you connect). If you want to do this (or if someone else > does), go ahead, otherwise I'll do it later. > > BTW, || makes no sense. Imagine lsearch [image names] my_pic returns 0, so > there's no my_pic, and $force is 1. It will throw a bug report... Imagine > lsearch [image names] my_pic == 1 and force == 0, it will delete the image > when not needed (or when I'm not sure it's needed), and also delete > my_pic_small . > > That's what I think in a huge rush, I should prepare myself and go to the > city center ASAP... > > Viv > > On Sat, 4 Mar 2006, Arieh Schneier wrote: > > > Was just looking at the log and came across this, I haven't looked at the > > code, or to see if anyone has sent an email about this. But should this > > line: > > > > > + if {[lsearch [image names] my_pic] != -1 && $force} { > > > + image delete my_pic > > > + catch {image delete my_pic_small} > > > + } > > > > be: > > > > > + if {[lsearch [image names] my_pic] != -1 || $force} { > > > + image delete my_pic > > > + catch {image delete my_pic_small} > > > + } > > > > ? ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Amsn-devel mailing list Amsn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/amsn-devel