mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-24 09:24:27 +08:00
mdbx: fix unsigned-to-ptrdiff casting inside estimate().
Fixup after a238179c23
Change-Id: I316e4aa1f41462fd0017f8e0a7f6d6e82aa4f3db
This commit is contained in:
@@ -17670,7 +17670,7 @@ __hot static ptrdiff_t estimate(const MDBX_db *db,
|
||||
* level-N: branch-page(s) => scale = leaf-factor
|
||||
* leaf-level: leaf-page(s) => scale = 1
|
||||
*/
|
||||
ptrdiff_t btree_power = db->md_depth - 2 - dr->level;
|
||||
ptrdiff_t btree_power = (ptrdiff_t)db->md_depth - 2 - (ptrdiff_t)dr->level;
|
||||
if (btree_power < 0)
|
||||
return dr->diff;
|
||||
|
||||
|
Reference in New Issue
Block a user