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:
parent
1e10eb8fdf
commit
e819451416
1 changed files with 4 additions and 0 deletions
|
@ -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]);
|
||||
|
|
Loading…
Reference in a new issue