From 8a2c833d1ff02957d2fbd15640e876a5247a1b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Mon, 14 Dec 2015 13:53:05 +0100 Subject: erl_prim_loader: Clean up string_match() Part of the return value for string_match/3 is not used by its only caller. Eliminate the unused part of the return value and the accumulator argument for string_match(). --- erts/preloaded/src/erl_prim_loader.erl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'erts') diff --git a/erts/preloaded/src/erl_prim_loader.erl b/erts/preloaded/src/erl_prim_loader.erl index 91ef2bd6d0..5f88029585 100644 --- a/erts/preloaded/src/erl_prim_loader.erl +++ b/erts/preloaded/src/erl_prim_loader.erl @@ -1214,22 +1214,22 @@ name_split(undefined, File) -> name_split(ArchiveFile, File0) -> %% Look first in primary archive File = absname(File0), - case string_match(real_path(File), ArchiveFile, []) of + case string_match(real_path(File), ArchiveFile) of no_match -> %% Archive or plain file name_split(undefined, File); - {match, _RevPrimArchiveFile, FileInArchive} -> + {match, FileInArchive} -> %% Primary archive {archive, ArchiveFile, FileInArchive} end. -string_match([Char | File], [Char | Archive], RevTop) -> - string_match(File, Archive, [Char | RevTop]); -string_match([] = File, [], RevTop) -> - {match, RevTop, File}; -string_match([$/ | File], [], RevTop) -> - {match, RevTop, File}; -string_match(_File, _Archive, _RevTop) -> +string_match([Char | File], [Char | Archive]) -> + string_match(File, Archive); +string_match([] = File, []) -> + {match, File}; +string_match([$/ | File], []) -> + {match, File}; +string_match(_File, _Archive) -> no_match. archive_split("/"++File, RevExt, Acc) -> -- cgit v1.2.3