Skip to content

Commit 0d4352d

Browse files
Alexander Shturmmeta-codesync[bot]
authored andcommitted
Replace andalso with comma in guard expressions
Summary: Replace 'andalso' with ',' in guard expressions across 95 modules. In Erlang guards, 'andalso' and ',' are semantically equivalent for guard conjunction. Using ',' is the more idiomatic style for guards. This change only addresses simple cases: - Guard expressions where 'andalso' appears at the top level (not inside parentheses) - Lines that don't contain 'orelse' (to avoid complex expressions) Complex cases with nested expressions or mixed 'andalso'/'orelse' are intentionally skipped to avoid potential semantic changes. NOTE: We encourage you to commandeer this GenAI-created diff for collaborative edits and verification. --- > [Session](https://www.internalfb.com/confucius?session_id=a4ab572a-fef4-11f0-bc71-ceec5db8591d&tab=Chat) | Prompt: in guard expressions, replace andalso with ',' and replace orelse with ';' - in simple cases. address as many instances as possible. ignore test modules. don't modify more than 100 modules. create a diff. | Owner: `ashturm` Reviewed By: thepulkitagarwal Differential Revision: D91983023 fbshipit-source-id: 809bde2de84a5da8b7bc343db4f15f69c519ba9c
1 parent 9de72d1 commit 0d4352d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/wa_diff.erl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,22 @@ format_error(Reason, [{_M, _F, _Args, Info} | _]) ->
163163
-spec diff_value(supported_input(), supported_input(), context()) -> diff().
164164
diff_value(Same, Same, _Context) ->
165165
#{equivalent => true, left => Same, right => Same};
166-
diff_value(Left, Right, _Context) when is_number(Left) andalso is_number(Right) ->
166+
diff_value(Left, Right, _Context) when is_number(Left), is_number(Right) ->
167167
diff_literal(Left, Right);
168-
diff_value(Left, Right, _Context) when is_atom(Left) andalso is_atom(Right) ->
168+
diff_value(Left, Right, _Context) when is_atom(Left), is_atom(Right) ->
169169
diff_literal(Left, Right);
170-
diff_value(Left, Right, Context) when is_tuple(Left) andalso is_tuple(Right) ->
170+
diff_value(Left, Right, Context) when is_tuple(Left), is_tuple(Right) ->
171171
diff_tuple(tuple_to_list(Left), tuple_to_list(Right), Context);
172-
diff_value(Left, Right, Context) when is_map(Left) andalso is_map(Right) ->
172+
diff_value(Left, Right, Context) when is_map(Left), is_map(Right) ->
173173
diff_struct(map, Left, Right, Context);
174-
diff_value(Left, Right, Context) when is_list(Left) andalso is_list(Right) ->
174+
diff_value(Left, Right, Context) when is_list(Left), is_list(Right) ->
175175
case io_lib:printable_unicode_list(Left) andalso io_lib:printable_unicode_list(Right) of
176176
true ->
177177
diff_string(inspect_string(Left), inspect_string(Right));
178178
false ->
179179
diff_container(list, Left, Right, Context)
180180
end;
181-
diff_value(Left, Right, _Context) when is_binary(Left) andalso is_binary(Right) ->
181+
diff_value(Left, Right, _Context) when is_binary(Left), is_binary(Right) ->
182182
case is_printable(Left) andalso is_printable(Right) of
183183
true ->
184184
diff_string(inspect_binary(Left), inspect_binary(Right));

0 commit comments

Comments
 (0)