Skip to content

Commit

Permalink
Merge pull request #8771 from richcarl/silly-vars
Browse files Browse the repository at this point in the history
Replace silly variable names that may show up in tooling
  • Loading branch information
garazdawi authored Sep 2, 2024
2 parents 6b04556 + cb508ea commit 6ac1e43
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/stdlib/src/binary.erl
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ _Examples:_
OnePos :: non_neg_integer(),
Result :: binary().
replace(Haystack,Needles,Replacement,Options) ->
replace(Subject,Pattern,Replacement,Options) ->
try
true = is_binary(Replacement) orelse is_function(Replacement, 1), % Make badarg instead of function clause
{Part,Global,Insert} = get_opts_replace(Options,{no,false,[]}),
Expand All @@ -762,9 +762,9 @@ replace(Haystack,Needles,Replacement,Options) ->
end,
MList = if
Global ->
binary:matches(Haystack,Needles,Moptlist);
binary:matches(Subject,Pattern,Moptlist);
true ->
case binary:match(Haystack,Needles,Moptlist) of
case binary:match(Subject,Pattern,Moptlist) of
nomatch -> [];
Match -> [Match]
end
Expand All @@ -781,12 +781,12 @@ replace(Haystack,Needles,Replacement,Options) ->
Splits = splitat(Replacement,0,lists:sort(Li)),
fun(M) -> lists:join(M, Splits) end
end,
erlang:iolist_to_binary(do_replace(Haystack,MList,ReplList,0))
erlang:iolist_to_binary(do_replace(Subject,MList,ReplList,0))
catch
throw:badopt ->
badarg_with_cause([Haystack,Needles,Replacement,Options], badopt);
badarg_with_cause([Subject,Pattern,Replacement,Options], badopt);
_:_ ->
badarg_with_info([Haystack,Needles,Replacement,Options])
badarg_with_info([Subject,Pattern,Replacement,Options])
end.
Expand Down

0 comments on commit 6ac1e43

Please sign in to comment.