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

Commit

Permalink
Merge pull request #63 from square/jw/nano-optimiziation
Browse files Browse the repository at this point in the history
Save some bytes in the object header by inlining set.
  • Loading branch information
Alec Strong authored and Alec Strong committed Sep 22, 2015
2 parents 47c20a2 + 91959d6 commit 133ac0b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public final class BriteDatabase implements Closeable {
getWriteableDatabase().endTransaction();
// Send the triggers after ending the transaction in the DB.
if (transaction.commit) {
sendTableTrigger(transaction.triggers);
sendTableTrigger(transaction);
}
}

Expand Down Expand Up @@ -146,7 +146,7 @@ SQLiteDatabase getWriteableDatabase() {
private void sendTableTrigger(Set<String> tables) {
SqliteTransaction transaction = transactions.get();
if (transaction != null) {
transaction.triggers.addAll(tables);
transaction.addAll(tables);
} else {
if (logging) log("TRIGGER %s", tables);
triggers.onNext(tables);
Expand Down Expand Up @@ -521,9 +521,9 @@ private static String conflictString(@ConflictAlgorithm int conflictAlgorithm) {
}
}

private static final class SqliteTransaction implements SQLiteTransactionListener {
static final class SqliteTransaction extends LinkedHashSet<String>
implements SQLiteTransactionListener {
final SqliteTransaction parent;
final Set<String> triggers = new LinkedHashSet<>();
boolean commit;

SqliteTransaction(SqliteTransaction parent) {
Expand Down

0 comments on commit 133ac0b

Please sign in to comment.