perf: short-circuit Slice equality on length mismatch#6338
perf: short-circuit Slice equality on length mismatch#6338VolodymyrBg wants to merge 1 commit intoOpenZeppelin:masterfrom
Conversation
|
The latest updates on your security scan. Learn more about OpenZeppelin Platform.
|
|
WalkthroughThe 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Memory.equal(Slice, Slice)always computed twokeccak256hashes even when slice lengths differed — making equality impossible by definition.Bytes.equalin the same codebase already short-circuits ona.length == b.lengthbefore hashing.Added an early return false when
lenA != lenB, skip bothkeccak256and_pointerextraction. Consistent withBytes.equalpattern.