rspec/rules/S2365/description.adoc
2020-06-30 17:16:12 +02:00

2 lines
366 B
Plaintext

Most developers expect property access to be as efficient as field access. However, if a property returns a copy of an array or collection, it will be much slower than a simple field access, contrary to the caller's likely expectations. Therefore, such properties should be refactored into methods so that callers are not surprised by unexpectedly poor performance.