Redundant "result and result or value" in the code #7244
MeanSquaredError
started this conversation in
General
Replies: 1 comment 1 reply
-
|
It's equivalent, but this is an earlier style, and I haven't changed it yet to ensure consistent code style. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There are several places in the code where the expression
result and result or valueis used. So far I found these ones:xmake/xmake/core/sandbox/modules/import/lib/detect/find_programver.lua
Line 73 in 766a7a8
(
result and result or nil)xmake/xmake/core/sandbox/modules/import/lib/detect/find_programver.lua
Line 111 in 766a7a8
(
result and result or false)xmake/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
Line 335 in 766a7a8
(
result and result or nil)xmake/xmake/core/sandbox/modules/import/lib/detect/find_program.lua
Line 356 in 766a7a8
(
result and result or false)xmake/xmake/modules/lib/detect/find_package.lua
Line 100 in 766a7a8
(
result and result or false)xmake/xmake/modules/lib/detect/find_package.lua
Line 126 in 766a7a8
(
result and result or nil)It seems to me that the
result and result or valuecan be replaced just byresult or value, since the two expressions are identical. For exampleresult and result or nilcould be replaced byresult or nilOr am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions