Re: [PATCH v5 01/15] Add new git-related helper to contrib
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- May 19, 2013, 15:13 UTC
- Message-ID
- <CALkWK0kz-pQ9UJPXerFoui9ftNXDzD-xhpkSHY=JX3rbFXgp-g@mail.gmail.com>
- In-Reply-To
- <CAMP44s1xguzX=iavUJxYXBEPOpGvJtJ_7FDHNCWMrF6qxOsuOQ@mail.gmail.com>
Felipe Contreras wrote:
> How exactly is it not equivalent to len = len || 1?
Here, I dug up an article for you on the issue:
http://www.rubyinside.com/what-rubys-double-pipe-or-equals-really-does-5488.html
Although it's fine in this case, I wouldn't recommend using ||= because of the potential confusion.