Skip to content
This repository was archived by the owner on Aug 17, 2020. It is now read-only.

Commit 133ac0b

Browse files
Alec StrongAlec Strong
authored andcommitted
Merge pull request #63 from square/jw/nano-optimiziation
Save some bytes in the object header by inlining set.
2 parents 47c20a2 + 91959d6 commit 133ac0b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sqlbrite/src/main/java/com/squareup/sqlbrite/BriteDatabase.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public final class BriteDatabase implements Closeable {
8585
getWriteableDatabase().endTransaction();
8686
// Send the triggers after ending the transaction in the DB.
8787
if (transaction.commit) {
88-
sendTableTrigger(transaction.triggers);
88+
sendTableTrigger(transaction);
8989
}
9090
}
9191

@@ -146,7 +146,7 @@ SQLiteDatabase getWriteableDatabase() {
146146
private void sendTableTrigger(Set<String> tables) {
147147
SqliteTransaction transaction = transactions.get();
148148
if (transaction != null) {
149-
transaction.triggers.addAll(tables);
149+
transaction.addAll(tables);
150150
} else {
151151
if (logging) log("TRIGGER %s", tables);
152152
triggers.onNext(tables);
@@ -521,9 +521,9 @@ private static String conflictString(@ConflictAlgorithm int conflictAlgorithm) {
521521
}
522522
}
523523

524-
private static final class SqliteTransaction implements SQLiteTransactionListener {
524+
static final class SqliteTransaction extends LinkedHashSet<String>
525+
implements SQLiteTransactionListener {
525526
final SqliteTransaction parent;
526-
final Set<String> triggers = new LinkedHashSet<>();
527527
boolean commit;
528528

529529
SqliteTransaction(SqliteTransaction parent) {

0 commit comments

Comments
 (0)