Skip to content

refactor: remove possibly unnecessary call to lfs_ctz_fromle32#1195

Closed
udovichenkoAlexander wants to merge 1 commit intolittlefs-project:masterfrom
udovichenkoAlexander:master
Closed

refactor: remove possibly unnecessary call to lfs_ctz_fromle32#1195
udovichenkoAlexander wants to merge 1 commit intolittlefs-project:masterfrom
udovichenkoAlexander:master

Conversation

@udovichenkoAlexander
Copy link
Copy Markdown

In lfs_dir_getinfo lfs_ctz_fromle32 results not used if entry is LFS_TYPE_INLINESTRUCT.

In most cases, the compiler will optimize this anyway. But in debug builds, it makes sense.

@geky-bot
Copy link
Copy Markdown
Collaborator

Tests passed ✓, Code: 17128 B (+0.0%), Stack: 1448 B (+0.0%), Structs: 812 B (+0.0%)
Code Stack Structs Coverage
Default 17128 B (+0.0%) 1448 B (+0.0%) 812 B (+0.0%) Lines 2437/2598 lines (-0.0%)
Readonly 6234 B (+0.0%) 448 B (+0.0%) 812 B (+0.0%) Branches 1288/1624 branches (-0.0%)
Threadsafe 17980 B (+0.0%) 1448 B (+0.0%) 820 B (+0.0%) Benchmarks
Multiversion 17200 B (+0.0%) 1448 B (+0.0%) 816 B (+0.0%) Readed 29000746676 B (+0.0%)
Migrate 18792 B (+0.0%) 1752 B (+0.0%) 816 B (+0.0%) Proged 1482895246 B (+0.0%)
Error-asserts 17952 B (+0.0%) 1440 B (+0.0%) 812 B (+0.0%) Erased 1568921600 B (+0.0%)

@geky geky added enhancement needs minor version new functionality only allowed in minor versions labels Mar 24, 2026
@geky
Copy link
Copy Markdown
Member

geky commented Mar 24, 2026

Hi @udovichenkoAlexander, thanks for creating a PR.

I think you're right the full lfs_ctz_fromle32 is not necessary. Though @geky-bot confirms the compiler is smart enough to omit the unused fromle32.

To be honest, given the state of things with v3 on the horizon (#1111, unstable), the current feature freeze, and the compiler handling things, I'm not sure this is worth merging.

Some of the reason for lfs_ctz_fromle32 immediately after the lfs_dir_get is to reduce the likelyhood that any fields are used without fromle32 in a future refactor.

@udovichenkoAlexander
Copy link
Copy Markdown
Author

Some of the reason for lfs_ctz_fromle32 immediately after the lfs_dir_get is to reduce the likelyhood that any fields are used without fromle32 in a future refactor.

Ok. So just close it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement needs minor version new functionality only allowed in minor versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants