Feng Lee 10 лет назад
Родитель
Сommit
4ee2abdbcf
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      include/emqttd_internal.hrl

+ 4 - 0
include/emqttd_internal.hrl

@@ -29,3 +29,7 @@
         lists:zip(record_info(fields, Def),
                   tl(tuple_to_list(Rec)))).
 
+-define(record_to_proplist(Def, Rec, Fields),
+    [{K, V} || {K, V} <- ?record_to_proplist(Def, Rec),
+                         lists:member(K, Fields)]).
+