aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/re.erl
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2010-12-17 17:05:47 +0100
committerPatrik Nyblom <[email protected]>2010-12-17 17:05:47 +0100
commit69486d5b01b3281ea1c9ca168b2658c1159a82ce (patch)
treea0fa6cd26a6938b7d38b9f409750635e7a9da7a1 /lib/stdlib/src/re.erl
parentb3feb428e2489ef8813e36f14c3e8d9b4f4deaba (diff)
downloadotp-69486d5b01b3281ea1c9ca168b2658c1159a82ce.tar.gz
otp-69486d5b01b3281ea1c9ca168b2658c1159a82ce.tar.bz2
otp-69486d5b01b3281ea1c9ca168b2658c1159a82ce.zip
Remove dead code (and dialyzer errors) from filename and re
Diffstat (limited to 'lib/stdlib/src/re.erl')
-rw-r--r--lib/stdlib/src/re.erl42
1 files changed, 19 insertions, 23 deletions
diff --git a/lib/stdlib/src/re.erl b/lib/stdlib/src/re.erl
index 296a6b3d23..9642de17b4 100644
--- a/lib/stdlib/src/re.erl
+++ b/lib/stdlib/src/re.erl
@@ -208,29 +208,25 @@ replace(Subject,RE,Replacement,Options) ->
process_repl_params(Options,iodata,false),
FlatSubject = to_binary(Subject, Unicode),
FlatReplacement = to_binary(Replacement, Unicode),
- case do_replace(FlatSubject,Subject,RE,FlatReplacement,NewOpt) of
- {error,_Err} ->
- throw(badre);
- IoList ->
- case Convert of
- iodata ->
- IoList;
- binary ->
- case Unicode of
- false ->
- iolist_to_binary(IoList);
- true ->
- unicode:characters_to_binary(IoList,unicode)
- end;
- list ->
- case Unicode of
- false ->
- binary_to_list(iolist_to_binary(IoList));
- true ->
- unicode:characters_to_list(IoList,unicode)
- end
- end
- end
+ IoList = do_replace(FlatSubject,Subject,RE,FlatReplacement,NewOpt),
+ case Convert of
+ iodata ->
+ IoList;
+ binary ->
+ case Unicode of
+ false ->
+ iolist_to_binary(IoList);
+ true ->
+ unicode:characters_to_binary(IoList,unicode)
+ end;
+ list ->
+ case Unicode of
+ false ->
+ binary_to_list(iolist_to_binary(IoList));
+ true ->
+ unicode:characters_to_list(IoList,unicode)
+ end
+ end
catch
throw:badopt ->
erlang:error(badarg,[Subject,RE,Replacement,Options]);