[Mono-dev] DateTime/DateTimeFormatInfo patch to reduce Clone()

Mirco Bauer meebey at meebey.net
Tue Dec 5 18:19:34 EST 2006


On Mon, 2006-12-04 at 20:09 +0100, Paolo Molaro wrote:
> On 11/30/06 Atsushi Eno wrote:
> > I noticed that many string[] properties in DateTimeFormatInfo are
> > used directly in DateTime. They have to return Clone() which are
> > not neccessary there.
> 
> If the arrays are exposed to the user, we should clone them, otherwise
> the user can change the values in the arrays and break later code.

*cough* lack of const *cough*

sorry could not resist :-P

> When used internally you could reference the array without cloning,
> though.
> 
> lupus
> 
-- 
Regards,

Mirco 'meebey' Bauer

PGP-Key:
http://keyserver.noreply.org/pks/lookup?op=get&search=0xEEF946C8

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d s-:+ a-- C++ UL++++$ P L++$>+++$ E- W+++$ N o? K- w++>! O---- M-
V? PS
PE+ Y- PGP++ t 5+ X++ R tv+ b+ DI? D+ G>++ e h! r->++ y?
------END GEEK CODE BLOCK------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: This is a digitally signed message part
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20061206/35e7b7bc/attachment.bin 


More information about the Mono-devel-list mailing list