1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-02 13:14:39 +00:00

Optimize flag operation

This commit is contained in:
M66B 2022-01-28 15:13:27 +01:00
parent 1e10eb8fdf
commit e819451416

View file

@ -156,10 +156,14 @@ public class EntityOperation {
boolean set = jargs.getBoolean(1);
List<String> keywords = new ArrayList<>(Arrays.asList(message.keywords));
if (set == keywords.contains(keyword))
return;
while (keywords.remove(keyword))
;
if (set)
keywords.add(keyword);
Collections.sort(keywords);
message.keywords = keywords.toArray(new String[0]);