View mode: basic / threaded / horizontal-split · Log in · Help
May 22, 2008
Re: std.algorithm issue
dood u got ur credits crossed. d chick not bearophile said u should submit a bug report. then bearophile not d chick said merging strings is bad. afaiu d chick prolly put string concat in there as an example. peace

Brian Myers Wrote:

> I'll look into submitting a bug report to Walter. Thanx bearophile.
> 
> Dee Girl, I'm actually not merging strings. The strings are file names. Merge is the merge phase for an external sort. In my next project I'll use map to do something like what you're talking about. I'll have to test the difference between map!-ing a custom function and doing join, and using reduce and a custom function.
> 
> Thanx to both of you.
> 
> Brian
> 
> bearophile Wrote:
> 
> > Brian Myers:
> > >     string Merge(string f1, string f2) {
> > >     .
> > >     .
> > >     .
> > >     }
> > 
> > I don't exactly know what you are trying to do, but using s1~s2 to merge an array of strings is probably O(n^2) if the higher order functions you use (or the compiler) aren't smart enough.
> > There is a join() function in std.string that is O(1), and there's a faster version of it in my libs (and probably in Tango too).
> > 
> > Bye,
> > bearophile
>
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home