I'm not so sure what is improved about this. The author's first attempt must have been quite poor.
It has poor help, with the comments mostly in French. It has no H1 line. No error checking. A poor interface - it requires you name your function fit_fun.
The author knows little about writing efficient code, and relatively little about Matlab from what we see in this example. This is a tool written by a novice programmer, and the inexperience shows.
If you want a usable particle swarm tool, there are FAR better alternatives to be found on the file exchange.