Made lfsr_bshrub_init a bit safer
We don't strictly need to initialize all of the shrub fields, but the
path of bnulls -> bshrubs -> btrees in the file logic is complex. It's
highly likely leaving these uninitialized will cause bugs in the future.
This does come with a small code cost, but better safe than sorry:
code stack ctx
before: 36436 2608 640
after: 36476 (+0.1%) 2608 (+0.0%) 640 (+0.0%)
This commit is contained in:
@@ -6131,7 +6131,10 @@ static int lfsr_shrub_commit(lfs_t *lfs, lfsr_rbyd_t *rbyd_,
|
||||
// create a non-existant bshrub
|
||||
static void lfsr_bshrub_init(lfsr_bshrub_t *bshrub) {
|
||||
bshrub->weight = 0;
|
||||
bshrub->blocks[0] = -1;
|
||||
bshrub->trunk = 0;
|
||||
// force estimate recalculation
|
||||
bshrub->eoff = -1;
|
||||
}
|
||||
|
||||
static inline bool lfsr_bshrub_isbnull(const lfsr_bshrub_t *bshrub) {
|
||||
|
||||
Reference in New Issue
Block a user