]> git.ktnx.net Git - mobile-ledger.git/commitdiff
reuse the SQL parameter list that is the same for the 5 calls
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 28 Mar 2019 22:14:34 +0000 (00:14 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 28 Mar 2019 22:14:34 +0000 (00:14 +0200)
app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java

index 459c3b5c45ac1e0e32f69009243aa9d16f21ca06..6ebba5762da199c65223f3c4702b73c970c319cf 100644 (file)
@@ -268,11 +268,12 @@ public final class MobileLedgerProfile {
         Log.d("db", String.format("removing profile %s from DB", uuid));
         db.beginTransaction();
         try {
-            db.execSQL("delete from profiles where uuid=?", new Object[]{uuid});
-            db.execSQL("delete from accounts where profile=?", new Object[]{uuid});
-            db.execSQL("delete from account_values where profile=?", new Object[]{uuid});
-            db.execSQL("delete from transactions where profile=?", new Object[]{uuid});
-            db.execSQL("delete from transaction_accounts where profile=?", new Object[]{uuid});
+            Object[] uuid_param = new Object[]{uuid};
+            db.execSQL("delete from profiles where uuid=?", uuid_param);
+            db.execSQL("delete from accounts where profile=?", uuid_param);
+            db.execSQL("delete from account_values where profile=?", uuid_param);
+            db.execSQL("delete from transactions where profile=?", uuid_param);
+            db.execSQL("delete from transaction_accounts where profile=?", uuid_param);
             db.setTransactionSuccessful();
         }
         finally {