Commit c1b61e9
committed
Simplify the logic in _require.erb
If we take the expression:
!(_item['require'] && _item['require'] != '') && _item['require'] !~ /unmanaged/i && !(_item['auth_require'])
This is hard to read, but equal to:
(!_item['require'] || _item['require'] == '') && _item['require'] !~ /unmanaged/i && !(_item['auth_require'])
This makes it easier to see that item must be `nil` or `''`. Those will
never match `/unmanaged/i` so it can be simplified to:
(!_item['require'] || _item['require'] == '') && !(_item['auth_require'])
Just before it is a block that already checks the last section, so it
can be reduced to an elsif on that block.1 parent ce06491 commit c1b61e9
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
0 commit comments