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

Commit 07e1b1dd authored by Vasu Nori's avatar Vasu Nori Committed by Android (Google) Code Review
Browse files

Merge "reduce java locking on SQLiteDatabase if sql is already compiled"

parents 6d9e1e63 b2d2ddc5
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -76,11 +76,6 @@ public abstract class SQLiteProgram extends SQLiteClosable {
    }

    private void compileSql() {
        if (nStatement > 0) {
            // already compiled.
            return;
        }

        // only cache CRUD statements
        if (getSqlStatementType(mSql) == OTHER_STMT) {
            mCompiledSql = new SQLiteCompiledSql(mDatabase, mSql);
@@ -165,6 +160,10 @@ public abstract class SQLiteProgram extends SQLiteClosable {
            attachObjectToDatabase(db);
        }
        // compile the sql statement
        if (nStatement > 0) {
            // already compiled.
            return;
        }
        mDatabase.lock();
        try {
            compileSql();