Jesse Phillips wrote: >First off no. Second, is their really going to be a performance gain >from this. I wouldn't expect static strings to be converted very >often. And last I will copy and past a comment from the source code:
Thanks for your reply. In case you don't know: gettext is used to translate strings. You call gettext("english string") and it returns the translated string. Gettext might be the only corner case, but the strings gettext returns are usually not cached and big projects could translate many strings, so I thought it could be an issue. But maybe I'm overestimating that. I had a look at the source code of toStringz and found the comment you mentioned. The comment is for toStringz(const(char)[] s) toStringz(string s) is even more interesting in this case as it does do that optimization in most cases. I think that's good enough ;-) -- Johannes Pfau
signature.asc
Description: PGP signature