try...catch slooowness?

Michel Fortin michel.fortin at michelf.com
Sun Dec 19 04:47:11 PST 2010


On 2010-12-19 07:33:29 -0500, spir <denis.spir at gmail.com> said:

>     // pointer
>     t0 = time();
>     foreach (n ; 0..N2) {
>         p = (n in table);
>         if (p) b = table[n];
>     }

But why the double lookup? Just dereference the pointer:

	foreach (n ; 0..N2) {
		p = (n in table);
		if (p) b = *p;
	}


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list