🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #29

Re: Boxing and unboxing

#29
From: Andre
Date: Sat, 06 May 2006 16:52
28 lines
1994 bytes
Thanks for the feedback,

Ok, my code worked, but then i remembered about the ref keyword. Isn't it 
better to use the ref prefix in the method signature rather than the boxing?
Using boxed object means that i have to work with object-type, but i'd 
rather work with the known types. Which is preformance wise a better choice?

private void doSome(ref DataSet _ds)
{
    adp.Fill(_ds);
}

Thanks for the help again.



"Marc Rohloff [TeamB]" <"on request"> wrote in message 
news:16i3bfc9nqjks.dlg@dlg.marcrohloff.com...
> On Fri, 5 May 2006 23:18:35 +0100, Joanna Carter [TeamB] wrote:
>
>> Neither is there any real penalty in casting from object to a class.
> There is no penalty in the downcast (to object), however the cast back
> to a Dataset requires a type check which is fairly costly (although
> not as costly as true unboxing)
>
> -- 
> Marc Rohloff [TeamB]
> marc rohloff -at- myrealbox -dot- com 
Technical Details
Message-ID: <445cd440@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <445bb0fa@newsgroups.borland.com> <445bcf41@newsgroups.borland.com> <16i3bfc9nqjks.dlg@dlg.marcrohloff.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,17b83a1499eb2170
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Andre" <andretruter@webmail.co.za>
Newsgroups: borland.public.csharpbuilder.language.csharp
References: <445bb0fa@newsgroups.borland.com> <445bcf41@newsgroups.borland.com> <16i3bfc9nqjks.dlg@dlg.marcrohloff.com>
Subject: Re: Boxing and unboxing
Date: Sat, 6 May 2006 18:52:21 +0200
Lines: 30
Organization: Bluewater Systems
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-Antivirus: avast! (VPS 0618-3, 05/05/2006), Outbound message
X-Antivirus-Status: Clean
NNTP-Posting-Host: 196.207.45.253
Message-ID: <445cd440@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1146934336 196.207.45.253 (6 May 2006 09:52:16 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail