Skip to content

Commit

Permalink
Refactor truncate() function in FileTree class and improve logging st…
Browse files Browse the repository at this point in the history
…atement
  • Loading branch information
janjurca committed Apr 19, 2024
1 parent 2f9bb30 commit 625cced
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/filestorm/filetree.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ class FileTree {
std::uintmax_t hole_size = old_size / 2;
std::uintmax_t start = 0, end = hole_size;
while (end < new_size) {
if (index < 300) {
spdlog::debug("start: {}, end: {}, hole_size: {}, new_size: {}, index: {}, old_size: {}", start, end, hole_size, new_size, index, old_size);
} else {
throw std::runtime_error("Too many iterations");
}

start = end;
hole_size = hole_size / 2;
end = start + hole_size;
Expand Down

0 comments on commit 625cced

Please sign in to comment.