commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Lucas (JIRA)" <>
Subject [jira] [Commented] (IMAGING-117) SofnSegment.components - public mutable array
Date Wed, 23 Oct 2013 18:05:42 GMT


Gary Lucas commented on IMAGING-117:

I recommend caution on this kind of change.  If we make a "safe copy" of an array every time
a get() method asks for one, we could end up making a lot of redundant copies of the same
thing.  This action would have a strongly negative impact on performance especially in image
processing where some of these calls are made (literally) millions of times.  

It is probably better to restrict the "safe copy" tactic to public methods only and just hope
that whoever writes code using protected methods is careful enough to not modify an array
he gets from the method.  

> SofnSegment.components - public mutable array
> ---------------------------------------------
>                 Key: IMAGING-117
>                 URL:
>             Project: Commons Imaging
>          Issue Type: Bug
>            Reporter: Sebb

This message was sent by Atlassian JIRA

View raw message