Skip to content

Commit 9b76e0a

Browse files
semaperepelitsabbatsov
authored andcommitted
Use and/or operators for control flow as recommended
1 parent 927480e commit 9b76e0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@ Avoid multi-line `?:` (the ternary operator); use `if`/`unless` instead.
15541554
=== `if` as a Modifier [[if-as-a-modifier]]
15551555

15561556
Prefer modifier `if`/`unless` usage when you have a single-line body.
1557-
Another good alternative is the usage of control flow `&&`/`||`.
1557+
Another good alternative is the usage of control flow `and`/`or`.
15581558

15591559
[source,ruby]
15601560
----
@@ -1567,7 +1567,7 @@ end
15671567
do_something if some_condition
15681568
15691569
# another good option
1570-
some_condition && do_something
1570+
some_condition and do_something
15711571
----
15721572

15731573
=== Multi-line `if` Modifiers [[no-multiline-if-modifiers]]

0 commit comments

Comments
 (0)