zookeeper: fomula always ignore --c option #15267

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

'or' and '=' pair cause unexpected result in 'or' chain.

Behavior check code:

a = nil
b = nil
c = 0
p a or b or c     #=> nil - old code
p (a or b) or c   #=> nil
p ((a or b) or c) #=> 0   - fixed code
@repeatedly repeatedly zookeeper: fomula always ignore --c option
'or' and '=' pair cause unexpected result in 'or' chain.

Behavior check code:
```ruby
a = nil
b = nil
c = 0
p a or b or c     #=> nil - old code
p (a or b) or c   #=> nil
p ((a or b) or c) #=> 0   - fixed code
```
a19e360
adamv commented on a19e360 Oct 3, 2012

Should we be using || too?

Yes, '||' works too.
I followed original 'or' code.

Contributor
adamv commented Oct 3, 2012

I'm not a ruby expert; is or or || recommended in general?

I don't know...
It depends on coding guidelines.

Personally, "or" is mainly used in some projects.

@adamv adamv closed this in 2183707 Oct 3, 2012

Thanks!

Contributor
adamv commented Oct 4, 2012

Thanks for the report

@snakeyroc3 snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this pull request Dec 17, 2012
@adamv adamv zookeeper: fix option checking
Fixes #15267.
f246eec
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.