Skip to content

Commit a47d7c2

Browse files
remove deleteParent from TreeOverlayStore
Summary: `deleteParent` and `deleteTree` are the same method, and in my opinion its confusing to have both Reviewed By: chadaustin Differential Revision: D38556246 fbshipit-source-id: 2e3319c338f6e85bde4f0bbd6cb42c5eab6f2a80
1 parent 21eb0ac commit a47d7c2

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

eden/fs/inodes/treeoverlay/TreeOverlayStore.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,7 @@ constexpr size_t kBatchInsertSize = 8;
4141

4242
struct TreeOverlayStore::StatementCache {
4343
explicit StatementCache(LockedSqliteConnection& db)
44-
: deleteParent{db, "DELETE FROM ", kEntryTable, " WHERE parent = ?"},
45-
selectTree{
46-
db,
47-
"SELECT name, dtype, inode, hash FROM ",
48-
kEntryTable,
49-
" WHERE parent = ? ORDER BY name"},
44+
: selectTree{db, "SELECT name, dtype, inode, hash FROM ", kEntryTable, " WHERE parent = ? ORDER BY name"},
5045
countChildren{
5146
db,
5247
"SELECT COUNT(*) FROM ",
@@ -112,7 +107,6 @@ struct TreeOverlayStore::StatementCache {
112107
return PersistentSqliteStatement{db, fmt::to_string(stmt_buffer)};
113108
}
114109

115-
PersistentSqliteStatement deleteParent;
116110
PersistentSqliteStatement selectTree;
117111
PersistentSqliteStatement countChildren;
118112
PersistentSqliteStatement deleteTree;
@@ -272,7 +266,7 @@ void TreeOverlayStore::saveTree(
272266
db_->transaction([&](auto& txn) {
273267
// When `saveTree` gets called, caller is expected to rewrite the tree
274268
// content. So we need to remove the previously stored version.
275-
auto stmt = cache_->deleteParent.get(txn);
269+
auto stmt = cache_->deleteTree.get(txn);
276270
stmt->bind(1, inodeNumber.get());
277271
stmt->step();
278272

0 commit comments

Comments
 (0)