From 62999c1521abe478bbdb92e758eb72ce2001c9ef Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 8 Dec 2021 22:56:39 +0100 Subject: [PATCH] Refactoring --- app/src/main/java/eu/faircode/email/EntityRule.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index 9b1ef48b9b..266bbafbe0 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -281,7 +281,6 @@ public class EntityRule { if (!keywords.contains(keyword)) return false; } else { - boolean matches = false; if (headers == null) { if (message.headers == null) throw new IllegalArgumentException(context.getString(R.string.title_rule_no_headers)); @@ -289,6 +288,8 @@ public class EntityRule { ByteArrayInputStream bis = new ByteArrayInputStream(message.headers.getBytes()); headers = Collections.list(new InternetHeaders(bis).getAllHeaders()); } + + boolean matches = false; for (Header header : headers) { String formatted = header.getName() + ": " + header.getValue(); if (matches(context, message, value, formatted, regex)) {