move list_to_bin on filterMessageText for clarity

This commit is contained in:
Tom Quackenbush 2016-09-30 16:55:33 +00:00
parent 78bb06c6aa
commit 3faa47df45
2 changed files with 2 additions and 2 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -49,11 +49,11 @@ filterMessageText(MessageAttrs, MessageText) ->
MessageWords = string:tokens(unicode:characters_to_list(MessageText, utf8), " "),
MessageTerms = [{Lang, Word} || Word <- MessageWords],
% we get back bytewise format terms (rather than utf8)
list_to_binary(string:join(filterWords(MessageTerms), " ")).
string:join(filterWords(MessageTerms), " ").
filterMessageBodyElements([{xmlel, <<"body">>, BodyAttr, [{xmlcdata, MessageText}]} = _H|T], MessageElements) ->
FilteredMessageWords = filterMessageText(BodyAttr, binary:bin_to_list(MessageText)),
FilteredMessageWords = binary:list_to_bin(filterMessageText(BodyAttr, binary:bin_to_list(MessageText))),
FilteredBody = {xmlel, <<"body">>, BodyAttr, [{xmlcdata, FilteredMessageWords}]},
filterMessageBodyElements(T, lists:append(MessageElements, [FilteredBody]));