diff options
author | Oguz Kocer <oguz.kocer@automattic.com> | 2016-06-16 15:15:35 +0300 |
---|---|---|
committer | Oguz Kocer <oguz.kocer@automattic.com> | 2016-06-16 15:15:35 +0300 |
commit | 0abc6f26dd3f24321d4a5480770e59e7edd9d9dc (patch) | |
tree | f1741fb42486f1f6ca43653ece636c207f4f4ee0 /WordPress/src/main/java/org/wordpress/android/datasets/PeopleTable.java | |
parent | 97c4e31109a4e3f555f9db4a0aa8548fe33016f6 (diff) | |
download | gradle-perf-android-medium-0abc6f26dd3f24321d4a5480770e59e7edd9d9dc.tar.gz |
Sql queries in PeopleTable should use Integer.toString instead of Boolean.toString
Diffstat (limited to 'WordPress/src/main/java/org/wordpress/android/datasets/PeopleTable.java')
-rw-r--r-- | WordPress/src/main/java/org/wordpress/android/datasets/PeopleTable.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/WordPress/src/main/java/org/wordpress/android/datasets/PeopleTable.java b/WordPress/src/main/java/org/wordpress/android/datasets/PeopleTable.java index 13068fff7..9c851852a 100644 --- a/WordPress/src/main/java/org/wordpress/android/datasets/PeopleTable.java +++ b/WordPress/src/main/java/org/wordpress/android/datasets/PeopleTable.java @@ -113,12 +113,12 @@ public class PeopleTable { } public static void deleteUsersForLocalBlogId(int localTableBlogId) { - String[] args = new String[]{Integer.toString(localTableBlogId), Boolean.toString(false)}; + String[] args = new String[]{Integer.toString(localTableBlogId), Integer.toString(0)}; getWritableDb().delete(PEOPLE_TABLE, "local_blog_id=?&is_follower=?", args); } public static void deleteFollowersForLocalBlogId(int localTableBlogId) { - String[] args = new String[]{Integer.toString(localTableBlogId), Boolean.toString(true)}; + String[] args = new String[]{Integer.toString(localTableBlogId), Integer.toString(1)}; getWritableDb().delete(PEOPLE_TABLE, "local_blog_id=?&is_follower=?", args); } @@ -137,7 +137,7 @@ public class PeopleTable { int deleteCount = size - fetchLimit; String[] args = new String[] { Integer.toString(localTableBlogId), - Boolean.toString(isFollower), + Integer.toString(isFollower ? 1 : 0), Integer.toString(deleteCount) }; getWritableDb().delete(PEOPLE_TABLE, "local_blog_id=?1 AND is_follower=?2 AND person_id " + @@ -151,7 +151,7 @@ public class PeopleTable { } private static int getPeopleCountForLocalBlogId(int localTableBlogId, boolean isFollower) { - String[] args = new String[]{Integer.toString(localTableBlogId), Boolean.toString(isFollower)}; + String[] args = new String[]{Integer.toString(localTableBlogId), Integer.toString(isFollower ? 1 : 0)}; String sql = "SELECT COUNT(*) FROM " + PEOPLE_TABLE + " WHERE local_blog_id=?&is_follower=?"; return SqlUtils.intForQuery(getReadableDb(), sql, args); } @@ -174,7 +174,7 @@ public class PeopleTable { } public static List<Person> getEmailFollowers(int localTableBlogId) { - String[] args = { Integer.toString(localTableBlogId), Integer.toString(1) }; + String[] args = { Integer.toString(localTableBlogId), Integer.toString(1)}; String where = "WHERE local_blog_id=?1 AND is_follower=?2 AND is_email_follower=?2"; return PeopleTable.getPeople(localTableBlogId, where, args); } |