Reduce allocation in shared RArray clearing.
Merge pull request #2447 from take-cheeze/reduce_ary_clear_alloc

Reduce allocation in shared RArray clearing.
reformat else part; ref #2447