Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
Use pattern match for info_dispatch/1
Browse files Browse the repository at this point in the history
  • Loading branch information
jj1bdx committed May 22, 2018
1 parent bec03aa commit 1a94670
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/aprs_is_decode.erl
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ decode_header(D, {CPS, CPI, CPR, CPEND}) ->
{Source, Destination, Relay, Info}.

info_dispatch(Info) ->
case binary:at(Info, 0) of
$! -> first_exclamation(Info);
<<Type:8, Rest/binary>> = Info,
case Type of
$! -> first_exclamation(Rest);
_ -> undefined
end.

first_exclamation(Info) ->
Info,
true.
first_exclamation(Rest) ->
Rest.

0 comments on commit 1a94670

Please sign in to comment.