-
-
Save pichi/402828 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proplists_get_value(Key, List)-> | |
case lists:keyfind(Key,1,List) of | |
{K,V} when K =:= Key -> | |
V; | |
_-> | |
proplists_get_value_(Key, List) | |
end. | |
proplists_get_value_(_,[])-> | |
undefined; | |
proplists_get_value_(Key,[Key|Tail]) -> | |
true; | |
proplists_get_value_(Key,[_|Tail]) -> | |
proplists_get_value_(Key,Tail). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment