aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/persistance
diff options
context:
space:
mode:
authorM. Dietrich <mdt@emdete.de>2014-09-01 10:40:45 +0200
committerM. Dietrich <mdt@emdete.de>2014-09-01 10:40:45 +0200
commit2acf510ea97666919ac066a2bf312f47a386ac56 (patch)
treeb28eb88e6b8335af6b655c40af8ada563b5b93c6 /src/eu/siacs/conversations/persistance
parent3558fa5f5bcbf73ecb5c8174b208ac0c36e708b1 (diff)
optimize string operations a bit
Diffstat (limited to 'src/eu/siacs/conversations/persistance')
-rw-r--r--src/eu/siacs/conversations/persistance/DatabaseBackend.java4
-rw-r--r--src/eu/siacs/conversations/persistance/FileBackend.java2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/persistance/DatabaseBackend.java b/src/eu/siacs/conversations/persistance/DatabaseBackend.java
index 22871a9e..2a403fab 100644
--- a/src/eu/siacs/conversations/persistance/DatabaseBackend.java
+++ b/src/eu/siacs/conversations/persistance/DatabaseBackend.java
@@ -137,7 +137,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
public CopyOnWriteArrayList<Conversation> getConversations(int status) {
CopyOnWriteArrayList<Conversation> list = new CopyOnWriteArrayList<Conversation>();
SQLiteDatabase db = this.getReadableDatabase();
- String[] selectionArgs = { "" + status };
+ String[] selectionArgs = { Integer.toString(status) };
Cursor cursor = db.rawQuery("select * from " + Conversation.TABLENAME
+ " where " + Conversation.STATUS + " = ? order by "
+ Conversation.CREATED + " desc", selectionArgs);
@@ -163,7 +163,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
+ "=?", selectionArgs, null, null, Message.TIME_SENT
+ " DESC", String.valueOf(limit));
} else {
- String[] selectionArgs = { conversation.getUuid(), "" + timestamp };
+ String[] selectionArgs = { conversation.getUuid(), Long.toString(timestamp) };
cursor = db.query(Message.TABLENAME, null, Message.CONVERSATION
+ "=? and " + Message.TIME_SENT + "<?", selectionArgs,
null, null, Message.TIME_SENT + " DESC",
diff --git a/src/eu/siacs/conversations/persistance/FileBackend.java b/src/eu/siacs/conversations/persistance/FileBackend.java
index 6e16240d..0af9c6e2 100644
--- a/src/eu/siacs/conversations/persistance/FileBackend.java
+++ b/src/eu/siacs/conversations/persistance/FileBackend.java
@@ -180,7 +180,7 @@ public class FileBackend {
long size = file.getSize();
int width = scalledBitmap.getWidth();
int height = scalledBitmap.getHeight();
- message.setBody("" + size + "," + width + "," + height);
+ message.setBody(Long.toString(size) + ',' + width + ',' + height);
return file;
} catch (FileNotFoundException e) {
throw new ImageCopyException(R.string.error_file_not_found);