We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a666730 + 61a1b0b commit 8ed63b2Copy full SHA for 8ed63b2
lfs.c
@@ -404,18 +404,15 @@ struct lfs_diskoff {
404
405
// operations on global state
406
static inline void lfs_gstate_xor(lfs_gstate_t *a, const lfs_gstate_t *b) {
407
- for (int i = 0; i < 3; i++) {
408
- ((uint32_t*)a)[i] ^= ((const uint32_t*)b)[i];
409
- }
+ a->tag ^= b->tag;
+ a->pair[0] ^= b->pair[0];
+ a->pair[1] ^= b->pair[1];
410
}
411
412
static inline bool lfs_gstate_iszero(const lfs_gstate_t *a) {
413
414
- if (((uint32_t*)a)[i] != 0) {
415
- return false;
416
417
418
- return true;
+ return a->tag == 0
+ && a->pair[0] == 0
+ && a->pair[1] == 0;
419
420
421
#ifndef LFS_READONLY
0 commit comments