Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc1632e9 authored by RazorSharp's avatar RazorSharp Committed by Steve Kondik
Browse files

Codecleanup: Use Chained append calls to improve the performance

Change-Id: Ieb9d4ba314d4859f5f17af5cbedd8c06c06ac0b7
parent 9af5f0c7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -499,7 +499,7 @@ public final class DiskLruCache implements Closeable {
        }

        redundantOpCount++;
        journalWriter.append(READ + ' ' + key + '\n');
        journalWriter.append(READ + ' ').append(key).append('\n');
        if (journalRebuildRequired()) {
            executorService.submit(cleanupCallable);
        }
@@ -650,7 +650,7 @@ public final class DiskLruCache implements Closeable {
        }

        redundantOpCount++;
        journalWriter.append(REMOVE + ' ' + key + '\n');
        journalWriter.append(REMOVE + ' ').append(key).append('\n');
        lruEntries.remove(key);

        if (journalRebuildRequired()) {
@@ -967,3 +967,4 @@ public final class DiskLruCache implements Closeable {
        }
    }
}
+2 −1
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ public class AlbumSongLoader extends WrappedAsyncTaskLoader<List<Song>> {
        final StringBuilder selection = new StringBuilder();
        selection.append(AudioColumns.IS_MUSIC + "=1");
        selection.append(" AND " + AudioColumns.TITLE + " != ''");
        selection.append(" AND " + AudioColumns.ALBUM_ID + "=" + albumId);
        selection.append(" AND " + AudioColumns.ALBUM_ID + "=").append(albumId);
        return context.getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
                new String[] {
                        /* 0 */
@@ -136,3 +136,4 @@ public class AlbumSongLoader extends WrappedAsyncTaskLoader<List<Song>> {
    }

}
+1 −1
Original line number Diff line number Diff line
@@ -1280,7 +1280,7 @@ public final class MusicUtils {
    public static final AlbumArtistDetails getAlbumArtDetails(final Context context, final long trackId) {
        final StringBuilder selection = new StringBuilder();
        selection.append(MediaStore.Audio.AudioColumns.IS_MUSIC + "=1");
        selection.append(" AND " + BaseColumns._ID + " = '" + trackId + "'");
        selection.append(" AND " + BaseColumns._ID + " = '").append(trackId).append("'");

        Cursor cursor = context.getContentResolver().query(
            MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
+2 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ public class SrtParser {
                    subtitleBuilder.append(s);

                    while (!((s = br.readLine()) == null || s.trim().equals(""))) {
                        subtitleBuilder.append("\n" + s);
                        subtitleBuilder.append("\n").append(s);
                    }
                }

@@ -135,3 +135,4 @@ public class SrtParser {
        return hours * 60 * 60 * 1000 + minutes * 60 * 1000 + seconds * 1000 + millies;
    }
}