See Also: AvoidReturningArraysOnPropertiesRule Members
Example
public byte[] Foo {
get {
// return the data inside the instance
return foo;
}
}
public byte[] Bar {
get {
// return a copy of the instance's data
// (this is bad because users expect properties to execute quickly)
return (byte[]) bar.Clone ();
}
}
Example
public byte[] GetFoo ()
{
return (byte[]) foo.Clone ();
}
public byte[] GetFoo ()
{
return (byte[]) bar.Clone ();
}