Skip to content

Conversation

@chetanyb
Copy link
Contributor

@chetanyb chetanyb commented Nov 1, 2025

addresses blockblaz/zeam#331 (comment) and fixes blockblaz/zeam#336

  • use std.meta.eql for deep comparison for non primitive types

@chetanyb chetanyb requested a review from g11tech November 1, 2025 08:56
@chetanyb chetanyb requested a review from gballet as a code owner November 1, 2025 08:56
src/utils.zig Outdated

pub fn eql(self: *const Self, other: *Self) bool {
pub fn eql(self: *const Self, other: *const Self) bool {
// Compare lengths first, then use std.mem.eql for slice contents
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make sure comments bring some value, which is not the case with this (I presume ai-generated) one.

Suggested change
// Compare lengths first, then use std.mem.eql for slice contents

src/utils.zig Outdated
}
return true;
} else {
// For primitive types, use std.mem.eql
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// For primitive types, use std.mem.eql

- use std.meta.eql for deep comparison for non primitive types
@gballet gballet force-pushed the refAllDeclsRecursive-fix branch from 78f9333 to 48f7c46 Compare November 16, 2025 11:31
@gballet
Copy link
Collaborator

gballet commented Nov 16, 2025

One thing that is missing from this PR is that you say it fixes the problem, but if it does then you should also modify the tests to prove that it does. right it's in a different repo.

@gballet gballet merged commit 812f996 into blockblaz:master Nov 16, 2025
3 checks passed
@chetanyb chetanyb deleted the refAllDeclsRecursive-fix branch November 26, 2025 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix SSZ struct equality to enable refAllDeclsRecursive usage

2 participants