On Jun 17, 12:05 am, "Bob Powell [MVP]"
<bob@_spamkiller_bobpowell.net> wrote:
> You seem to be inferring that a cast takes time at runtime.
You seem to be implying that it doesn't
Unless the compiler can guarantee that the cast is valid (and not even
then, sometimes) the cast *will* take time at execution time. Not a
lot, but some.
To the OP: I wouldn't worry about the performance side, but the
clarity side. Creating a new object and reuing an old one are usually
significantly different operations, wiith different implications. Go
with whatever produces the cleanest, most natural code. If you're
logically operating on an existing object, do so - if you're logically
creating a new one, do that instead
Jon