From 4b308382c995b05685a8bbc885a4c5bca541c037 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 2 Mar 2019 07:36:57 +0000 Subject: [PATCH] Refactoring --- .../java/eu/faircode/email/EntityOperation.java | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EntityOperation.java b/app/src/main/java/eu/faircode/email/EntityOperation.java index 882d9ff770..ece98382d7 100644 --- a/app/src/main/java/eu/faircode/email/EntityOperation.java +++ b/app/src/main/java/eu/faircode/email/EntityOperation.java @@ -80,21 +80,10 @@ public class EntityOperation { static final String ATTACHMENT = "attachment"; static final String SYNC = "sync"; - static void queue(Context context, DB db, EntityMessage message, String name) { + static void queue(Context context, DB db, EntityMessage message, String name, Object... values) { JSONArray jargs = new JSONArray(); - queue(context, db, message, name, jargs); - } - - static void queue(Context context, DB db, EntityMessage message, String name, Object value) { - JSONArray jargs = new JSONArray(); - jargs.put(value); - queue(context, db, message, name, jargs); - } - - static void queue(Context context, DB db, EntityMessage message, String name, Object value1, Object value2) { - JSONArray jargs = new JSONArray(); - jargs.put(value1); - jargs.put(value2); + for (Object value : values) + jargs.put(value); queue(context, db, message, name, jargs); }