Uwe Stöhr wrote:
> There are other things to clean up in there, it is not clear what the different 'for' loop are
 > doing with the strings.

Then my comments are not good enough. \href requires some characters to be escaped or changed. The for loop parse the string for a certain character and do something with it when found. Every loop run checks for another character of the list.

OK, I guess we have some existing helper function that does that. If not, it makes sense to factorize the different search in a common helper function.


 > -       url = to_utf8(getParam("type")) + url;
 > +       url += getParam("type");

For me this format is not intuitive. With the format above you immediately see if it is

Oups, I've created a bug here, sorry you're right, I'll correct that.


url + x

yes.

or
x + url

no.

because this would result in a different output.

Well, that's the STL string notation, it's a matter of getting used to it. If you really don't like it you can also use url.append(...) which I agree is clearer. Using 'url = url + x' is not efficient memory and CPU wise as you have an additional instantiation and an additional copy.

Abdel.

Reply via email to